input: def optimize_code(input_code: str) -> str:
      """ Optimize the given Python code to use built-in functions.
      >>> optimize_code("def removeDuplicates(array): \n    for i in range (len(array)): \n        for j in range (i + 1, len(array)): \n            if array[i] == array[j]: \n                array.pop(j)")
      'def removeDuplicates(array): \n    finalArray = []\n    for element in array: \n        if element not in finalArray: \n            finalArray.append(element)\n    return finalArray'
      """
output:     lines = input_code.split('\n')
      optimized_lines = []
      for line in lines:
          if 'for i in range (len(array)):' in line:
              optimized_lines.append('    finalArray = []')
              optimized_lines.append('    for element in array:')
              optimized_lines.append('        if element not in finalArray:')
              optimized_lines.append('            finalArray.append(element)')
              optimized_lines.append('    return finalArray')
          else:
              optimized_lines.append(line)
      return '\n'.join(optimized_lines)