Write a function named rotate that accepts accepts a reference to a grid of integers as a parameter and rotates the grid 90 degrees clockwise.
You may assume the grid has the same number of rows as columns.
For example, if a variable named g stored the grid below at left, the call of rotate(g); would alter it to give it the new grid state at right:
{{ 6, 1, 9, 4}, {{21, 14, -2, 6},
{-2, 5, 8, 12}, {55, 39, 5, 1},
{14, 39, -6, 18}, --> {73, -6, 8, 9},
{21, 55, 73, -3}} {-3, 18, 12, 4}}