This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def solution(A, K): | |
A_length = len(A) | |
new_A_array = [0] * A_length | |
for index in range(A_length): | |
shift_index = (index+K) % A_length | |
new_A_array[shift_index] = A[index] | |
return new_A_array |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def solution(N): | |
if N < 0: return 0 | |
binary_string = bin(N)[2:] | |
max_gap_count = current_gap_count = 0 | |
for index in range(len(binary_string)): | |
if binary_string[index] == "0": | |
current_gap_count += 1 | |
else: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -name "._*" -exec rm -rf {} \; |
NewerOlder