I have a struct, for simplicity, let's call it State. State has many fields not related to each other. It also has a method IsWorse(State), which compares caller State to argument State and returns true if all caller State fields are worse or equal to argument State fields.
I want to quickly filter out states that are worse than any other states in the array, in other words, I want to filter out states that return true for method IsWorse at least once for any state in array.
I can already do this in O(n^2) time. I was thinking maybe there is a faster way.