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.
I get what we're going for here, but I can't help but notice that none of the methods this was probably designed to test are actually necessary. There's no reason to concatenate, or handle the length of each array, nor worry about which axis it will be joined on, because the damn input is already formatted as a 2d array!
importnumpyasnp# we don't need the first row, toss it:_=input()data=[]# assign each input() result to a variable and append it to our empty list:whileTrue:try:line=input()data.append(list(map(int,line.split())))exceptEOFError:breakarr=np.array(data)print(arr)`
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Concatenate
You are viewing a single comment's thread. Return to all comments →
I get what we're going for here, but I can't help but notice that none of the methods this was probably designed to test are actually necessary. There's no reason to concatenate, or handle the length of each array, nor worry about which axis it will be joined on, because the damn input is already formatted as a 2d array!