Ugh... My MethodBuilder is not concurrency-safe. But I think I've made a much simpler solution than others, it's also not tied to the Thing class and can be used for any class.
Seems like your N's is to small to see benefits from Counter. Your solution is O(n^2), so for large N, your solution will be much slower than op's solution (wich is O(n))
Ugh... My MethodBuilder is not concurrency-safe. But I think I've made a much simpler solution than others, it's also not tied to the Thing class and can be used for any class.
Seems like your N's is to small to see benefits from Counter. Your solution is O(n^2), so for large N, your solution will be much slower than op's solution (wich is O(n))