Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
squaredigits
//Rextester.Program.Main is the entry point for your code. Don't change it. //Microsoft (R) Visual C# Compiler version 2.9.0.63208 (958f2354) using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { //Your code goes here Console.WriteLine(SquareDigits("aaabcccdeeef")); } public static char SquareDigits(string s) { Dictionary<char, int> cd = new Dictionary<char, int>(); int count; for(int i = 0; i< s.Length; i++ ){ cd.TryGetValue(s[i], out count); cd[s[i]] = count +1; } return cd.FirstOrDefault(x => x.Value == 1).Key; } } }
run
|
edit
|
history
|
help
0
30272 Program Ex5 if_else2_odd_even
Use ConcurrentQueue and ConcurrentDictionary with TPL (Simple example)
TrzyKreski
Uri Parts
Generics
Swedish regex test
PhoneBook- Dictionary
BiologyQuestions
error2
Math 5.83b