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.
Your statement "The solution is O(n) and traverses the given list only once. " is not true. While you are explicitly traversing the list only once, the functions max() and index() both implicitly traverse the list in order to perform their function.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Migratory Birds
You are viewing a single comment's thread. Return to all comments →
Your statement "The solution is O(n) and traverses the given list only once. " is not true. While you are explicitly traversing the list only once, the functions max() and index() both implicitly traverse the list in order to perform their function.