You are viewing a single comment's thread. Return to all comments →
One liner is always better, but i dont really like to compress the size, moreover this is more readable:
def getWays(squares, d, m): count = 0 for i in range(0,len(squares)+1-m): if sum(squares[i:i+m]) == d: count+=1 return count
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 →
One liner is always better, but i dont really like to compress the size, moreover this is more readable: