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.
if((y)<=len(list))
will always return true since len(list)==n+1 to start with and hence redundant. This condition makes more sense if len(list)==n.
This code will work perfectly fine though, just pointing out in case someone is confused regarding why this condition check is there.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Array Manipulation
You are viewing a single comment's thread. Return to all comments →
The condition check