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.
I suppose practice. Practice list comprehensions enough and it can get easy. This is a list comprehension that adds 1 to a list everytime the sum in that range is equal to d. Then len is used to count all the 1s in that list. I learned list comprehensions through learning haskell.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Subarray Division
You are viewing a single comment's thread. Return to all comments →
I suppose practice. Practice list comprehensions enough and it can get easy. This is a list comprehension that adds 1 to a list everytime the sum in that range is equal to d. Then len is used to count all the 1s in that list. I learned list comprehensions through learning haskell.