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.
Remarks: You don't need to create the list of the values you want to sum (except when you want to use them twice, as (more or less) required for W). So the "list()" and [...] are not needed (except for W), which will save space & time required for memory allocation.
Also, split() is not needed for the single value N and ' ' is default & thus not needed in split().
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 0: Weighted Mean
You are viewing a single comment's thread. Return to all comments →
+1 for the use of zip().
Remarks: You don't need to create the list of the values you want to sum (except when you want to use them twice, as (more or less) required for W). So the "list()" and [...] are not needed (except for W), which will save space & time required for memory allocation.
Also, split() is not needed for the single value N and ' ' is default & thus not needed in split().