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.
Yeah easier code for a human to read and write, but probably worse, performance-wise because Count() is probably iterating through var a 3 times when using longer code would allow you to solve the problem by only iterating through var a once. (this is only a guess because I'm not familiar with Linq or Python's inner workings)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Plus Minus
You are viewing a single comment's thread. Return to all comments →
Yeah easier code for a human to read and write, but probably worse, performance-wise because Count() is probably iterating through var a 3 times when using longer code would allow you to solve the problem by only iterating through var a once. (this is only a guess because I'm not familiar with Linq or Python's inner workings)