Oracle interview question

Rotting Oranges Leet Code Question