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.
It seems the test cases are kind of weak. I have a solution that it's very slow when the input it's sorted. i.e. when the fences are [1, 2, 3, 4, 5, 6]
To give an idea, I tried with [1..30000], compiled with ghc -O2, and it took 29 seconds, and the input size constrain is 100000
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
John and Fences
You are viewing a single comment's thread. Return to all comments →
It seems the test cases are kind of weak. I have a solution that it's very slow when the input it's sorted. i.e. when the fences are [1, 2, 3, 4, 5, 6]
To give an idea, I tried with [1..30000], compiled with ghc -O2, and it took 29 seconds, and the input size constrain is 100000