input: Write a python function to compare each element in an array with a given number and return a list of strings 'greater than', 'less than', or 'equal to' based on the comparison.
  assert checkNum([3, 5, 7], 4) == ['less than', 'greater than', 'greater than']
  assert checkNum([10, 20, 30], 25) == ['less than', 'less than', 'greater than']
  assert checkNum([1, 2, 3], 2) == ['less than', 'equal to', 'greater than']
output: def checkNum(arr, num):
      result = []
      for x in arr:
          if x > num:
              result.append('greater than')
          elif x < num:
              result.append('less than')
          else:
              result.append('equal to')
      return result