Computer Science, asked by Anonymous, 3 months ago

ᎻᎾᏯ ᴅᴏ ʏᴏᴜ ᴘʀɪɴᴛ ᴀ ᴅᴜᴘʟɪᴄᴀᴛᴇ ᴄʜᴀʀᴀᴄᴛᴇʀ ɪɴ ᴀ sᴛʀɪɴɢ?

₲ØØĐ ₥ØⱤ₦ł₦₲! ​

Answers

Answered by ushasingh9191
5

 \huge \fbox \pink{{✿Answer}}

Program to find the duplicate characters in a string

Explanation

In this program, we need to find the duplicate characters in the string.

To find the duplicate character from the string, we count the occurrence of each character in the string. If count is greater than 1, it implies that a character has a duplicate entry in the string. In above example, the characters highlighted in green are duplicate characters.

Algorithm

  1. Define a string.
  2. Two loops will be used to find the duplicate characters. Outer loop will be used to select a character and initialize variable count by 1.
  3. Inner loop will compare the selected character with rest of the characters present in the string.
  4. If a match found, it increases the count by 1 and set the duplicates of selected character by '0' to mark them as visited.
  5. After inner loop, if count of character is greater than 1, then it has duplicates in the string.

❥ the above is the answer of your question

❥ hope that's helps you

.

.

.

.

Very good morning dear ❤️..

have a great day ✨✨✨

Attachments:
Similar questions