Q)Java Program to find the duplicate characters in a string.

Опубликовано: 24 Октябрь 2024
на канале: Ingenious TechHub
1,233
23

Step1:- Creating a HashMap containing char as key and it's occurrences as value.

Step2:- Converting given string to char array.

Step3:- checking each char of strArray.

Step4:- If char is present in charCountMap, incrementing it's count by 1.

Step5:- If char is not present in charCountMap,
putting this char to charCountMap with 1 as it's value.

Step6:- Getting a Set containing all keys of charCountMap.
Step7:- Iterating through Set 'charsInString‘
Step8:- If any char has a count of more than 1, printing it's count
=============================================================
Hi There ,
Welcome back to Ingenious TechHub Family.
This is Mohit Kumar Working in MNC as Consultant Lead Engineer and (I am an Entrepreneur ,Software Trainer & IT job adviser)
We work on for Your success .

=============================================================
Bangalore job Seekers | Fresher guidance for searching and getting job In IT Free videos
=======================================================================
https://www.youtube.com/watch?v=bekvc...

============================================================
Note:- Please join facebook group page for future job notifications
  / ingenious123  
  / 10838.  .

=========================================================================
We provide Real Time Training for Different profile like Testing(Manual & Automation) & Development(Java & Python )
https://ingenioustechhub.blogspot.com...
https://ingenioustechhub.blogspot.com...
  / ingenious123  
  / 10838.  .
====================================================
https://www.youtube.com/watch?v=OmppY...
=============================================================
https://www.youtube.com/watch?v=9_OwS...

Core java Free tutorials
========================
https://www.youtube.com/watch?v=9_OwS...
====================================================
https://www.youtube.com/watch?v=9eZXv...

Selenium Free Tutorials
============================
https://www.youtube.com/watch?v=MtMWm...

=================================
Real time Interview preparation for Live session Free Videos
https://www.youtube.com/watch?v=OmppY...