Premium Only Content

Plus Minus - HackerRank - Java
Learn how to solve the HackerRank problem whose title is Plus Minus, using the Java programming language.
https://www.hackerrank.com/challenges/plus-minus
The Data Structures and Algorithms (DSA) lesson uses a running sum and loop to solving the question using Java.
Traversing the array, you can keep track of the count of positive and negative integers. The zero count can be calculated later by subtracting positive and negative count from the total number of elements in the array.
After getting the counts, you can calculate the ratio of each kind of count out of the total number of elements in the array.
The function doesn't return anything, but you have to print out the ratios in a specific order, in the specified format.
The time complexity for the solution is O(n) and its space complexity is O(1).
DSA problems are sometimes asked during tech job interviews for positions such as Software Engineer, so you can use the challenge to practice that skill.
-
15:10
SB Mowing
1 month agoShe had TEARS OF JOY on her face - An update on Beth
18.6K31 -
LIVE
Lofi Girl
3 years agolofi hip hop radio 📚 - beats to relax/study to
215 watching -
2:15:26
Nikko Ortiz
2 hours agoLIVE - Trying Rumble Studio!
169K5 -
9:30
Sugar Spun Run
6 hours ago $0.86 earnedBlack and White Cookies
83.6K1 -
2:45
SLS - Street League Skateboarding
4 days agoManny Santiago's 'THIS IS 40' Part
47.3K2 -
6:40
Homesteading Family
5 days agoNever Make Pie Crust From Scratch Again (Do THIS Instead)
39K5 -
44:20
Melissa K Norris
3 days ago $0.72 earnedThe Most Overlooked Way to Preserve Food for Months (No Freezer Needed) w/ Sam Knapp
28.2K1 -
23:00
Tony Jeffries
6 days agoThe Best & Worst Boxing Training Methods (Ranked by Olympic Boxer)
20.4K -
44:44
Scammer Payback
17 days agoCrazy Confrontation with Hacked Scammer Group
44.2K20 -
1:15:13
Steven Crowder
4 hours agoIt Isn't Both Sides: They Crossed The Rubicon When They Killed Charlie
430K376