Solution 2- Java Program to Count and Map Character Reversals in a String