Skip to content

Commit ec38228

Browse files
committed
Added Python solution for "Number of Subarrays With GCD Equal to K"
1 parent 4b95d58 commit ec38228

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

Python/Number of Subarrays With GCD Equal to K.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def subarrayGCD(self, nums: List[int], k: int) -> int:
2121

2222
if curr_gcd == k:
2323
sub_arrays += 1
24-
elif curr_gcd < k:
24+
elif curr_gcd < k or curr_gcd % k:
2525
break
2626

2727
return sub_arrays
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)