input: Write a function to flatten a nested list.
  assert flatten_list([[1, 2, 3], [4, [5, 6]]]) == [1, 2, 3, 4, 5, 6]
  assert flatten_list([1, [2, [3, 4], 5], 6]) == [1, 2, 3, 4, 5, 6]
  assert flatten_list([[1], [2, [3, [4, [5]]]]]) == [1, 2, 3, 4, 5]
output: def flatten_list(nested_list):
      flat_list = []
      
      def flatten(sublist):
          for item in sublist:
              if isinstance(item, list):
                  flatten(item)
              else:
                  flat_list.append(item)
      
      flatten(nested_list)
      return flat_list