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.
Second : Because of pop function, the length of list reduces inside the loop, though the loop continues to run till the index specified earlier. Hence, giving "out of range" error.
Remove these two errors, code will run fine.
Hope it helps ! :)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Sherlock and Moving Tiles
You are viewing a single comment's thread. Return to all comments →
Hi, there are two issues with the code.
First : you are using 'max' function over string without converting it to integer which would give different result. For example :
Second : Because of pop function, the length of list reduces inside the loop, though the loop continues to run till the index specified earlier. Hence, giving "out of range" error.
Remove these two errors, code will run fine.
Hope it helps ! :)