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.
'res' is okay, because we initiate a list before we start appending to it through the loop. Pretty sure TMWP01 responded to another comment, the one where 'm= -10000' is initiated inside an inner loop. So basically it's getting initialized multiple times, in each loop, instead just once - before the loop.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 11: 2D Arrays
You are viewing a single comment's thread. Return to all comments →
'res' is okay, because we initiate a list before we start appending to it through the loop. Pretty sure TMWP01 responded to another comment, the one where 'm= -10000' is initiated inside an inner loop. So basically it's getting initialized multiple times, in each loop, instead just once - before the loop.