I got this question in uber OA back few days back. I was able to pass all the sample test cases but it was showing TLE for hidden test cases. i think Order of K was too large. can you guys help with the optimized solution?


Comments (10)
I got this question in uber OA back few days back. I was able to pass all the sample test cases but it was showing TLE for hidden test cases. i think Order of K was too large. can you guys help with the optimized solution?

