https://codeanddebug.in/blog/rotting-oranges-leetcode-994/