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.
-
2:58:21
xBuRnTx
4 hours ago1st Warzone Stream Online
24.2K1 -
6:10:21
JdaDelete
1 day ago $2.23 earnedDino Crisis - Sega Saturday
28.4K1 -
23:22
MYLUNCHBREAK CHANNEL PAGE
1 day agoUnder The Necropolis - Pt 5
37.5K20 -
2:26:11
Jewels Jones Live ®
1 day agoWINNING BIGLY | A Political Rendezvous - Ep. 108
106K40 -
2:04:49
Bare Knuckle Fighting Championship
4 days agoBKFC FIGHT NIGHT MOHEGAN SUN FREE FIGHTS
44.1K4 -
25:09
BlackDiamondGunsandGear
7 hours agoYou NEED to be Training For Whats to Come
30.9K10 -
20:03
Sideserf Cake Studio
13 hours ago $1.41 earnedA HUNGRY HUNGRY HIPPOS CAKE THAT ACTUALLY WORKS?
32.2K11 -
23:51
marcushouse
14 hours ago $1.08 earnedStarship’s Next Move Is Coming Sooner Than You Think!
21.6K3 -
22:24
The Finance Hub
20 hours ago $7.11 earnedBREAKING: JOE ROGAN JUST DROPPED A MASSIVE BOMBSHELL!!!
24.5K25 -
55:02
PMG
9 hours ago $0.63 earnedHannah Faulkner and Miriam Shaw | Moms on A Mission
16.5K