mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-03-29 01:46:42 +00:00
add doctest
This commit is contained in:
parent
125138edf9
commit
fafde10729
@ -48,6 +48,12 @@ n is even.
|
||||
|
||||
class Solution:
|
||||
def can_arrange(self, arr: list[int], k: int) -> bool:
|
||||
"""
|
||||
Function to check if array pairs are divisible by k
|
||||
:param arr: List of integers
|
||||
:param k: Integer
|
||||
:return: Boolean
|
||||
"""
|
||||
sol_arr = [0 for i in range(k)]
|
||||
for i in arr:
|
||||
sol_arr[i % k] += 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user