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
np.set_printoptions(legacy='1.13')
print(np.eye(*map(int, input().split())))
Annoying that HackerRank uses "MathJax_SVG" to display code in their problem descriptions. I had to use Google Lens to copy the numpy.set_printoptions() code. (Because I didn't want to retype it myself.)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Eye and Identity
You are viewing a single comment's thread. Return to all comments →
Python (of course): My compact solution…
Annoying that HackerRank uses "MathJax_SVG" to display code in their problem descriptions. I had to use Google Lens to copy the
numpy.set_printoptions()
code. (Because I didn't want to retype it myself.)