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.
Using x in range(s, t) means that for each check, you have to do worst case scenario (t-s-1) equality comparisons. Using s <= x < t means that you do 2 comparisons for each check.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Apple and Orange
You are viewing a single comment's thread. Return to all comments →
Using
x in range(s, t)
means that for each check, you have to do worst case scenario (t-s-1) equality comparisons. Usings <= x < t
means that you do 2 comparisons for each check.