user
Write pseudocode to describe the following algorithm:

Now complete the following instance -
Input: Given an array of integers "arr", the algorithm should return the index of the first element in "arr" greater than or equal to the given target "num".
Output:
assistant
function getIndex(arr, num) 
  idx := 0
  while (idx < arr.length && arr[idx] < num) 
    idx := idx + 1
  return idx