Algorithm Pattern – Rotate & Spiral Array (LC 48 54 59)

Thought For the rotation question, we could get an easy approach by observing the rotation result. For the Spiral question, we should set the four dimension ranges and keep updating them. Example 48. Rotate Image (https://leetcode.com/problems/rotate-image/) You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise). …