input: Write a function to populate an array with random numbers from 1 to 100 based on a given array length. The function should return the populated array. If the provided array length is less than 1, the function should return an empty array.
  assert populateArray(5) in [[92, 15, 67, 32, 88], [45, 55, 66, 77, 88], [1, 2, 3, 4, 5]]
  assert populateArray(0) == []
  assert populateArray(-3) == []
output: import random
  
  def populateArray(length):
      if length < 1:
          return []
      return [random.randint(1, 100) for _ in range(length)]