📌  相关文章
📜  hackerrank 活跃交易者解决方案 - 任何代码示例

📅  最后修改于: 2022-03-11 14:57:37.987000             🧑  作者: Mango

代码示例2
public static List mostActive(List customers)
        {
            List res = new List();
            foreach (var c in customers)
            {
                double count = customers.Count(a => a.Contains(c));
                double per = (count / customers.Count()) * 100;
                if (!res.Contains(c) && per>=5)
                {
                    res.Add(c);
                }
            }
            return res.OrderBy(r=>r).ToList();
        }