I think I'm gonna go back to "easy" problems to boost my confidence, because despite doing this for 3 weeks now I feel like I've gotten worse at problem-solving.
HackerRank - Plus Minus (time: 9mins)
This one was too easy, but I still learned a new Java feature. If I want to get a number to a certain decimal point, I can use the DecimalFormat class to specify what my output will look like. So, after wrapping my ratio of positives, negatives, and zeros from an array into the DecimatFormat method numberFormat.format(number), I got to have my output be to 6 decimal points. Neat.
HackerRank - Mini-Max Sum (time: 4mins)
Anytime I have a problem involving an array of numbers, I first check to see if the order of numbers is important according to the question. If not, I immediately sort the array. In the case of this question, it helped to work with a sorted array because once I had the sum of all the numbers in the array, I can just subtract the first and last element of the sum to get the max and min totals, respectively.
HackerRank - Time Conversion (time: 5mins)
I did this question a few weeks ago, but the study set that I'm looking at and doing had this question, so I thought I'd give it a go again. This time, it took me less time and I used less lines of code, mostly because of the handing substring method Java has. The main part of this question is to determine whether the current time is in "AM" or "PM", and make changes accordingly. For "AM", if the hour is 12, then change it to "00". If it's "PM" and the time is 12, then don't do anything. Otherwise, add 12 to the hour. Then, combine it all together to get the time in military time (without the "AM/PM").