Implemented function to rotate 2D array by 90 degrees