Help me solve this hackerrank problem.



This hackerrank problem was asked in last week of code, I am having a hard time understanding it’s editorial, please help me solve it.


Thank you so much for the explanation and I have doubt.If you don’t mind can you explain your calculation part in your code in the “while loop”.Please

Thank You!


I was not able to think of compression of values, and that got me :frowning: . Can you share your code as well? It can clear the implementation doubts !! :slight_smile:


@vijju123 this is his code.


Wait, hackerrank allows you to see others solution?? Since when? O_O


After the contest :slight_smile:


Damn! I never knew that :confused: . It allows you to view others solution in practice section too?


Yes @vijju123


I edited a para of your answer for clarity. The * * were causing unnecessary italics. Have a check at it :slight_smile: