Eye and Identity

  • + 0 comments

    Python (of course): My compact solution…

    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.)