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.
for those wondering why their code doesn't work, is all because how pop() method is handled in both Python3 and PyPy3 (the default version of python in hackerrank). in Python3 it deletes the last index. in PyPy3, pop() method deletes the first number.
all you gotta do i switch to python3 and it will work <3.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Set .discard(), .remove() & .pop()
You are viewing a single comment's thread. Return to all comments →
for those wondering why their code doesn't work, is all because how pop() method is handled in both Python3 and PyPy3 (the default version of python in hackerrank). in Python3 it deletes the last index. in PyPy3, pop() method deletes the first number. all you gotta do i switch to python3 and it will work <3.