#find duplicate in a sorted array

# arr = [3,3,3,2,2,5,6,6]
# duplicates = []
# for i in range(1,len(arr)):
#     if arr[i-1] in arr[i:]:
#         if arr[i-1] not in duplicates:
#             duplicates.append(arr[i-1])
# print(duplicates)