public List <StoneType> CalcMostStoneTypes(StoneTypes stoneTypes) { Dictionary <StoneType, int> counter = CountStones(stoneTypes); int maxCount = counter.OrderBy(x => x.Value).First().Value; return(counter.Where(x => x.Value >= maxCount).Select(x => x.Key).ToList()); }
public Dictionary <StoneType, int> CountStones(StoneTypes stoneTypes) { Dictionary <StoneType, int> counter = new Dictionary <StoneType, int>(); foreach (var stoneType in stoneTypes.Types) { counter.Add(stoneType, CountStone(stoneType)); } return(counter); }