Day2: (Arrays)

  1. Set Matrix Zeros 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 Triangle Solved on: 17th July 2020

3. Next Permutation Learnt on 17th July 2020

Stock Buy and Sell Learnt on 24th July 2020

6. Rotate Matrix 90 degree Learnt on 27th July 2020

Last updated

Was this helpful?