Skip to content

Commit c8f2386

Browse files
author
Gonzalo Diaz
committed
[REFACTOR] clean code: variable naming
1 parent c325784 commit c8f2386

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/hackerrank/interview_preparation_kit/dictionaries_and_hashmaps/count_triplets_1.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ def count_triplets(arr, r):
2525
for i in arr:
2626
j = i // r
2727
k = i * r
28-
a[i] -= 1
29-
if b[j] and a[k] and i % r == 0:
30-
triplets += b[j] * a[k]
31-
b[i] += 1
28+
a_counter[i] -= 1
29+
if b_counter[j] and a_counter[k] and i % r == 0:
30+
triplets += b_counter[j] * a_counter[k]
31+
b_counter[i] += 1
3232

3333
return triplets

0 commit comments

Comments
 (0)