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