We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I kept adjusting my code, and got my solution to O(n), where n = number of queries, and it still didn't pass test case 10 due to time out. Cut out a bunch of fat from the Boilerplate, and finally got it everything to pass with my solution. Here's what I ended up with for my boilerplate:
Frequency Queries
You are viewing a single comment's thread. Return to all comments →
I kept adjusting my code, and got my solution to O(n), where n = number of queries, and it still didn't pass test case 10 due to time out. Cut out a bunch of fat from the Boilerplate, and finally got it everything to pass with my solution. Here's what I ended up with for my boilerplate:
Solution method does need to take in
int[][]
instead ofList<List<Integer>>