For Free SDET interview Preparation Sessions and for Notes follow
Telegram : https://t.me/+n4XjXIUoulxkMWQ1
Instagram: @EasyInterviewPreparation
Approach:
-Initialize a HashMap: Use a HashMap to store each character of the string as keys and their counts as values.
-Iterate Through the String: Loop through each character in the string and update the count in the map.
-Display the Character Counts: Print each character along with its count.
Methods Used: toCharArray(), Map - put(),containsKey(), get()