Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text.RegularExpressions;
- public class Kata
- {
- public static int DuplicateCount(string str)
- {
- str = str.ToLower();
- str = str.Replace(" ", "");
- int x = 0;
- for (int i = 0; i < str.Length; i++){
- for (int m = 0; m < str.Length; m++){
- if(str[m] == str[i] && m != i){
- x++;
- str = str.Replace(str[i].ToString(), "");
- }
- }
- }
- return x;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement