Determine if robot path is bounded | Oracle Interview Question