Nagarro Interview Question

Find nagaroo from a string in a particular order