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.
Array and Queries
Array and Queries
Sort by
recency
|
7 Discussions
|
Please Login in order to post a comment
Time Limit of this problem needs to be adjusted for Java.
Just by simply reading all the inputs, and let's say putting all the values into a HashMap and simply return 0 (no other calculation done), you already got TLE for ~10 test cases.
**for more info on problem visit below link https://www.hackerrank.com/contests/hackerrank-hiring-contest/challenges/array-and-queries-1/problem
I don't know how to solve yet, but, something I know is that the query modify just one element in the list. So maybe you should recalculate a partition of that list instead the entire list.
for me its timing out for 3 cases. How to approach efficiently ?
I was able to modify list A with the queries given, but I am stuck trying to find out the beautiful arrays.
I've given the frequencies of each integer in array A but not sure what to do from there. So far I have
{2 : 3, 1 : 2}
but don't know how to find beautiful array from that