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.
- Prepare
- Algorithms
- Search
- Absolute Element Sums
- Discussions
Absolute Element Sums
Absolute Element Sums
Sort by
recency
|
64 Discussions
|
Please Login in order to post a comment
JavaScript solution
I finally beated the hack. The key here is to note that, according to restrictions, there can be only 4001 different values for input, so we can characterize them by their value, and the number of occurrences for each. Then, it's pretty straightforward.
I am getting time limit exceeded on the 5th test, with C++20. But it runs on my laptop in 0.329s ... Any idea what's going on?
Here is my solution in java, javascript, python, C, C++, Csharp HackerRank Absolute Element Sums Solution
Here is the solution of Absolute Element Sums Click Here