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 bought the test case #3 to look at the input... It's a file bigger than 8 MB. How should it be possible to read in the input, compute and put out the resut in less than 4 seconds? I tried to optimize it, but it's still O(n^2) running time... The only correct test is #1, all the others are out of time. I'm a beginner, what could I do to do it better?
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
King Richard's Knights
You are viewing a single comment's thread. Return to all comments →
I bought the test case #3 to look at the input... It's a file bigger than 8 MB. How should it be possible to read in the input, compute and put out the resut in less than 4 seconds? I tried to optimize it, but it's still O(n^2) running time... The only correct test is #1, all the others are out of time. I'm a beginner, what could I do to do it better?