How does this relate to hashing and maps or tree data structures?


#1

I looked at the solution and it didn’t involve any of those, yet this problem is the test problem for hashing and maps and tree data structures


#2

The brute force double for loop gets a “Time Limit Exceeded” error. They are asking you to make it run faster by hashing value & index and only comparing to the items with a larger value.