Iterating through a map and stopping when condition is met

I want to create a function that takes a map as input. The map looks something like

%{
               1 => [
                 %{count: 2, group_rating: 13, members: [1, 4], ratings: [8, 5]}
               ],
               2 => [
                 %{count: 2, group_rating: 13, members: [2, 3], ratings: [6, 7]}
               ]
             }

The keys are numbers and I’m not sure how many keys I will get. I want to go through the map and return true if any elements have a count > 1.

What function should I be using for this? Should it be Enum.reduce_while(enumerable, acc, fun) ?

Checkout Enum.any?

5 Likes

Can you give an example of your desired output given the input in your post?