This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Rotation extends App { | |
val matrix = Array(Array(1,2), Array(3,4), Array(5,6)) | |
print(matrix) | |
print(transpose(matrix)) | |
print(rotate90(matrix)) | |
print(rotateMinus90(matrix)) | |
def transpose(matrix: Array[Array[Int]]): Array[Array[Int]] = { |