You are viewing a single comment's thread. Return to all comments →
a = [0] * n for _ in range(len(queries)): start = queries[_][0] end = queries[_][1] increment = queries[_][2] for i in range(start,end+1): a [i] = a[i] + increment print(a) maxi = 0; for _ in range(len(a)): if (maxi < a[_]): maxi = a [_] print (maxi)
Wierd: Code works in local machine but hackerranks list index is out of bounds.
Seems like cookies are disabled on this browser, please enable them to open this website
Array Manipulation
You are viewing a single comment's thread. Return to all comments →
Wierd: Code works in local machine but hackerranks list index is out of bounds.