We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
import numpy as np
n , m = [int(c) for c in input().split()]
nparr = np.empty(shape=(n, m),dtype = 'i4')
print(n ,m)
print(nparr)
for i in range(n):
lst = [int(c) for c in input().split()]
for j in range(m):
nparr[i][j] = lst[j]
nparr = np.min(nparr, axis=1)
nparr = np.max(nparr)
print(nparr)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Min and Max
You are viewing a single comment's thread. Return to all comments →
import numpy as np n , m = [int(c) for c in input().split()] nparr = np.empty(shape=(n, m),dtype = 'i4')
print(n ,m)
print(nparr)
for i in range(n): lst = [int(c) for c in input().split()] for j in range(m): nparr[i][j] = lst[j] nparr = np.min(nparr, axis=1) nparr = np.max(nparr) print(nparr)