We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d579a1 commit 31a6b8fCopy full SHA for 31a6b8f
src/hackerrank/interview_preparation_kit/arrays/cruch_bruteforce.py
@@ -6,16 +6,15 @@
6
LOGGER = logging.getLogger(__name__)
7
8
9
-def array_manipulation(n: int, queries: list[list[int]]) -> int:
10
-
11
- result = [0] * (n + 1)
+def array_manipulation(n_operations: int, queries: list[list[int]]) -> int:
+ result = [0] * (n_operations + 1)
12
maximum = 0
13
14
- for [a, b, k] in queries:
+ for [a_start, b_end, k_value] in queries:
15
16
LOGGER.debug("start -> %s", result)
17
- for j in range(a, b + 1):
18
- result[j] += k
+ for i in range(a_start, b_end + 1):
+ result[i] += k_value
19
LOGGER.debug("result -> %s", result)
20
21
for value in result:
0 commit comments