We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Algorithms
- Warmup
- Plus Minus
- Discussions
Plus Minus
Plus Minus
Sort by
recency
|
3229 Discussions
|
Please Login in order to post a comment
I absolutely love this theme idea — it looks stunning and very appealing! I’m planning to use it for my ecommerce-based store, mens compression socks, which is hosted on Shopify
javascript print negative first positive ?
negativeRatio positiveRatio zeroRatio
def plusMinus(arr): n=len(arr) count_p=0 count_neg=0 count_zero=0 for i in arr: if i>0: count_p+=1 elif i<0: count_neg+=1 elif i==0: count_zero+=1 print(count_p/n) print(round(count_neg/n,6)) print(round(count_zero/n,6))
No need to set the amount of decimals, it recognises the answers without needing the precise decimal point
Java 7 Solution
double postiveNum=0,negativeNum=0;