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


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


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.