Rotting Oranges - Leetcode 994 - Python