import pdb
import numpy as np


def reverse(original):
    rows = len(original)
    cols = len(original[0])
    new = [[0]*cols]*rows
    for i in range(rows):
        for j in range(cols):
            oppositeRow = rows-i
            new[oppositeRow][j]=original[i][j]
    return new
a = [[1,2],
[3,4],
[5,6]]
print(reverse(a))


###

def biggestCol(Mat):
    numCol = len(Mat[0])
    maxValue = -1
    maxIndex = -1

    #iterate over the columns of the matrix
    for col in range(numCol):
    #counts the number of nonzero values
        count = np.count_nonzero(Mat[:,col])
        if count > maxValue:
            maxValue = count
            maxIndex = col
    return maxIndex

#helper
def getCount(Mat,col):
    numRow = len(Mat)
    count = 0
    for row in range(numRow):
        count+= Mat[row][col] == 1
    return count

Mat = [[1,0,0,0],
[0,1,1,0],
[1,0,0,0],
[0,1,-1,1],
[0,0,1,0]]


# print("column index %d has the most non-zero values" % biggestCol(Mat))
