Grid Solution
Solution Explanation