You are viewing a single comment's thread. Return to all comments →
Here is Python 3 solution from my HackerrankPractice repository:
n = int(input()) arr = list(map(int, input().split())) print("{:.6f}".format(len([x for x in arr if x > 0]) / n)) print("{:.6f}".format(len([x for x in arr if x < 0]) / n)) print("{:.6f}".format(len([x for x in arr if x == 0]) / n))
Feel free to ask if you have any questions :)
Plus Minus
You are viewing a single comment's thread. Return to all comments →
Here is Python 3 solution from my HackerrankPractice repository:
Feel free to ask if you have any questions :)