Rotate Image (Rotate array values 90 degrees, clockwise)
Example 1:Given input matrix = [ [1,2,3], [4,5,6], [7,8,9] ], rotate the input matrix in-place such that it becomes: [ [7,4,1], [8,5,2], [9,6,3] ] This problem is to rotate the array values by 90 degrees. There is a constraint for this question. * Do not assign 2D array My approach is as below1. Transpose the array2. Reverse the each row class Solution: def rotate(self, matrix): """ :type matrix..
2019. 1. 16.
13. Roman to Integer
Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000For example, two is written as II in Roman numeral, just two one's added together. Twelve is written as, XII, which is simply X + II. The number twenty seven is written as XXVII, which is XX + V + II.Roman numerals are usually written largest to smallest from left to..
2019. 1. 12.