Eye and Identity

Sort by

recency

|

311 Discussions

|

  • + 0 comments
    import numpy as np
    np.set_printoptions(legacy='1.13')
    print(np.eye(*map(int,input().split())))
    
  • + 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.)

  • + 0 comments

    import numpy numpy.set_printoptions(legacy='1.13') N,M = map(int,input().split()) print(numpy.eye(N,M))

  • + 0 comments
    import numpy
    N, M= list(map(int, input().split()))
    numpy.set_printoptions(legacy= '1.13')
    print(numpy.eye(N, M, k = 0))
    
  • + 0 comments

    Here is HackerRank Eye and Identity in Python solution - https://programmingoneonone.com/hackerrank-eye-and-identity-problem-solution-in-python.html