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.
-
8:18
MattMorseTV
4 hours ago $3.88 earned2.2 MILLION in ONE YEAR.
18.5K103 -
14:37
Colion Noir
7 hours agoCanadian Police Chief Urges Citizens To Comply With Home Invaders And Hide
53.3K69 -
DVR
OVERKLOC
2 hours ago🔴LIVE - CHILL SUNDAY GAMING - WHO KNOWS WHAT WE'LL PLAY
2.99K -
LIVE
FrizzleMcDizzle
4 hours agoNightReign - Lies of P: Overture after - Come hang out
55 watching -
1:18:54
Jeff Ahern
5 hours ago $11.50 earnedThe Sunday Show with Jeff Ahern
56.6K6 -
32:05
Tactical Advisor
5 hours agoNew Thermal Target for the Military | Vault Room Live Stream 038
45.6K2 -
2:00:33
GamerGril
4 hours agoThe Evil Within 2 💕 Pulse Check 💕 Still Here
15.7K1 -
LIVE
ttvglamourx
8 hours ago $1.78 earnedPLAYING WITH VIEWERS !DISCORD
90 watching -
5:59:31
TheManaLord Plays
10 hours agoMANA SUMMIT - DAY 2 ($10,200+) | BANNED PLAYER SMASH MELEE INVITATIONAL
30.5K1 -
Jorba4
5 hours ago🔴Live-Jorba4- The Finals
18.3K