test.py 533 B

123456789101112131415161718192021222324252627282930
  1. import os
  2. def balancedSum(arr):
  3. # Write your code here
  4. length = arr[0]
  5. target = arr[1:]
  6. target.sort()
  7. for i in range(length):
  8. if(target[:i] == target[i:]):
  9. return i
  10. if __name__ == '__main__':
  11. # fptr = open(os.environ['OUTPUT_PATH'], 'w')
  12. arr_count = int(input().strip())
  13. arr = []
  14. for _ in range(arr_count):
  15. arr_item = int(input().strip())
  16. arr.append(arr_item)
  17. result = balancedSum(arr)
  18. fptr.write(str(result) + '\n')
  19. fptr.close()