Skip to content

Commit 5a12770

Browse files
Added working solution to EyeandIdentity
Previous solution failed all test cases. Code updated to working solution.
1 parent 7c573ac commit 5a12770

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Numpy/EyeandIdentity.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
Created : 15 July 2016
77
Problem : https://www.hackerrank.com/challenges/np-eye-and-identity/problem
88
'''
9-
import numpy
10-
n,m = map(int,input().split())
11-
print(numpy.eye(n,m,k=0))
9+
import numpy as np
10+
np.set_printoptions(sign=' ')
11+
print(np.eye(*map(int, input().split())))
12+

0 commit comments

Comments
 (0)