Oracle Interview Question

Solve the Rotten Orange question (Graph question available on the Leetcode)