In this HackerRank Default Arguments problem solution You are given a N X M integer array matrix with space separated elements (N = rows and M = columns). Your task is to print the transpose and flatten results.

HackerRank Transpose and Flatten in python problem solution

 HackerRank Transpose and Flatten in python problem solution

import numpy
n,m = map(int,raw_input().split())
a=[]
for i in xrange(n):
    a.append(map(int,raw_input().split()))

b = numpy.array(a)
#print a       
print numpy.transpose(b)
print b.flatten()