Skip to content

Commit cc9832b

Browse files
Added working soltuion to FloorCeilRint
Previous solution failed all test cases. Revised printed spacing in order to get all test cases right.
1 parent 7c573ac commit cc9832b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Numpy/FloorCeilandRint.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
Created : 15 July 2016
77
Problem : https://www.hackerrank.com/challenges/floor-ceil-and-rint/problem
88
'''
9-
import numpy
10-
np_ar = numpy.array(list(map(float,input().split())),float)
11-
print(numpy.floor(np_ar))
12-
print(numpy.ceil(np_ar))
13-
print(numpy.rint(np_ar))
9+
import numpy as np
10+
np.set_printoptions(sign=' ')
11+
a = np.array(input().split(), float)
12+
print(*(f(a) for f in [np.floor, np.ceil, np.rint]), sep='\n')

0 commit comments

Comments
 (0)