code: def find_duplicates(arr):
      n = len(arr)
      duplicates = set()
  
      for i in range(n):
          idx = abs(arr[i]) - 1
          val = arr[idx]
  
          if val > 0:
              # mark element as found for the first time
              arr[idx] = -val
          else:
              # this element is a duplicate
              duplicates.add(idx + 1)
  
      return duplicates
  
label_desc: Use image node_id 1 for calling a global function with example usage: find_duplicates(arr) and returns: duplicates