Day2: (Arrays)

  1. Set Matrix Zeros arrow-up-right Looked for answer on 16th July 2020

def setZeroes(self, matrix: List[List[int]]) -> None:
    """
    Do not return anything, modify matrix in-place instead.
    """
    rows = []
    columna = []
    for i in range(0 , len(matrix)):
        for j in range(0 , len(matrix[i])):
            if matrix[i][j] == 0:
                if i not in rows:
                    rows.append(i)
                if j not in columna:
                    columna.append(j)
    print (rows, columna)
    for i in rows:
        for j in range(0 , len(matrix[i])):
            matrix[i][j] = 0
    for i in columna:
        for j in range(0 , len(matrix)):
            matrix[j][i] = 0

2. Pascals Trianglearrow-up-right Solved on: 17th July 2020

3. Next Permutationarrow-up-right Learnt on 17th July 2020

Stock Buy and Sell arrow-up-right Learnt on 24th July 2020

6. Rotate Matrix 90 degreearrow-up-right Learnt on 27th July 2020

Last updated