Possible Amazon SDE Assessment
# Gifting groups
def countGroups(related):
count = 0
n = len(related)
for i in range(n):
print(related)
if related[i] != True:
count += 1
countHelper(related, related[i], n)
return count
# Algoritm Swap
def howManySwaps(arr, n):
# A temp_arr is created to store
# sorted array in merge function
temp_arr = [0]*n
return _merge_sort(arr, temp_arr, 0, n-1)