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.
Don't fall for the one-liner and standard library abuse anti-patterns on practice/competitive coding websites.
I can safely say that the number of times I've looked at someone's code professionally and said to myself "wow, they must be a good programmer, they really know the standard library well and can compress all their logic onto a single line with no additional variables" is exactly zero. Nada. Zilch.
The standard libraries don't know about your problem specification or data structures. Worry about coming up with the best scaling solution for your problem, then determine if standard library calls would work for your problem. (Often, especially with Python, the answer is "yes", but that's irrelevant.)
The compiler will define intermediate variables for you on its own, collapse your variables to suit its whims, and completely butcher the structure of your code when converting to machine language. Worry about making your code readable to humans.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Hash Tables: Ransom Note
You are viewing a single comment's thread. Return to all comments →
Don't fall for the one-liner and standard library abuse anti-patterns on practice/competitive coding websites.
I can safely say that the number of times I've looked at someone's code professionally and said to myself "wow, they must be a good programmer, they really know the standard library well and can compress all their logic onto a single line with no additional variables" is exactly zero. Nada. Zilch.
The standard libraries don't know about your problem specification or data structures. Worry about coming up with the best scaling solution for your problem, then determine if standard library calls would work for your problem. (Often, especially with Python, the answer is "yes", but that's irrelevant.)
The compiler will define intermediate variables for you on its own, collapse your variables to suit its whims, and completely butcher the structure of your code when converting to machine language. Worry about making your code readable to humans.