Skip to content

Commit 31a6b8f

Browse files
author
Gonzalo Diaz
committed
[REFACTOR] clean code: variable naming
1 parent 3d579a1 commit 31a6b8f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/hackerrank/interview_preparation_kit/arrays/cruch_bruteforce.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,15 @@
66
LOGGER = logging.getLogger(__name__)
77

88

9-
def array_manipulation(n: int, queries: list[list[int]]) -> int:
10-
11-
result = [0] * (n + 1)
9+
def array_manipulation(n_operations: int, queries: list[list[int]]) -> int:
10+
result = [0] * (n_operations + 1)
1211
maximum = 0
1312

14-
for [a, b, k] in queries:
13+
for [a_start, b_end, k_value] in queries:
1514

1615
LOGGER.debug("start -> %s", result)
17-
for j in range(a, b + 1):
18-
result[j] += k
16+
for i in range(a_start, b_end + 1):
17+
result[i] += k_value
1918
LOGGER.debug("result -> %s", result)
2019

2120
for value in result:

0 commit comments

Comments
 (0)