Skip to content

Commit e0629f4

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

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
@@ -28,9 +28,9 @@ def count_triplets(arr, r):
2828
for i in arr:
2929
j = i // r
3030
k = i * r
31-
a[i] -= 1
32-
if b[j] and a[k] and i % r == 0:
33-
triplets += b[j] * a[k]
34-
b[i] += 1
31+
a_counter[i] -= 1
32+
if b_counter[j] and a_counter[k] and i % r == 0:
33+
triplets += b_counter[j] * a_counter[k]
34+
b_counter[i] += 1
3535

3636
return triplets

0 commit comments

Comments
 (0)