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.
Is there a reason you wouldn't just store max(arr) in a separate variable first and use that in the list comprehension so that it's not called multiple times? Seems like a simple solution to reduce the number of calls.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Find the Runner-Up Score!
You are viewing a single comment's thread. Return to all comments →
Is there a reason you wouldn't just store max(arr) in a separate variable first and use that in the list comprehension so that it's not called multiple times? Seems like a simple solution to reduce the number of calls.