You are viewing a single comment's thread. Return to all comments →
I did something similar except I created a variable that is reverse of the input.
string tc = Console.ReadLine(); char[] tcArray = tc.ToCharArray(); char[] tcArrayReverse = tc.ToCharArray(); Array.Reverse(tcArrayReverse); for(int j = 0; j < (tcArray.Length/2); j++) { counter += Math.Abs(tcArray[j] - tcArrayReverse[j]); } Console.WriteLine(counter);
Seems like cookies are disabled on this browser, please enable them to open this website
The Love-Letter Mystery
You are viewing a single comment's thread. Return to all comments →
I did something similar except I created a variable that is reverse of the input.