Skip to content

Commit b9a370f

Browse files
committed
ts: remove excessive vars
1 parent 5f49751 commit b9a370f

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

typescript/Hash Maps and Sets/geometric_sequence_triplets.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,8 @@ function geometric_sequence_triplets(nums: number[], r: number): number {
1010
// Decrement the frequency of x in right_map since x is now being
1111
// processed and is no longer to the right.
1212
right_map[x] -= 1;
13-
if (x % r === 0) {
14-
const left_value = x / r;
15-
const right_value = x * r;
16-
count += (left_map[left_value] ?? 0) * (right_map[right_value] ?? 0);
17-
}
13+
if (x % r === 0)
14+
count += (left_map[x / r] ?? 0) * (right_map[x * r] ?? 0);
1815
// Increment the frequency of x in left_map since it'll be a part of the
1916
// left side of the array once we iterate to the next value of x.
2017
left_map[x] = (left_map[x] ?? 0) + 1;

0 commit comments

Comments
 (0)