Am I wrong? Also, I am not able to understand how it is going for a TLE.

1 Like

This question is same as this one…
You can check the editorial here…


Can u plz help me out for which case i m getting wrong answer

I am getting wrong answer too

Yeah, you are right it is the same question. Thank you!

Check your Output for this test case 66 50000000
Your O/P is: 'zzwvutrponmgdcaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
(This sums up to 75165824 which is wrong)

And my O/P is:
(This one sums up to 5e7)

Here is my code in Python using Heap.