input: Write a function to find the second smallest number in an array.
  assert second_smallest([5, 3, 4, 6, 1, 8]) == 3
  assert second_smallest([12, 13, 11, 14, 10]) == 11
  assert second_smallest([3, 2, 1, 4, 5]) == 2
output: def second_smallest(arr):
      if len(arr) < 2:
          return None  # Return None if there are less than 2 elements
      first, second = float('inf'), float('inf')
      for num in arr:
          if num <= first:
              first, second = num, first
          elif num < second:
              second = num
      return second