Search found 1 match

by teazy
Sat Aug 03, 2019 5:05 am
Forum: Challenges Solved
Topic: Valuation
Replies: 103
Views: 9369

C# with recursion

Works as well in C# with recursion private int Valuate(string text, int index) { if (index >= text.Length) { return 0; } if (text[index].ToString().Equals("x")) { text = text.Remove(index, 1); index = index - 2; if (index < 0) { index = 0; } return 0 + Valuate(text, index); } else { int nu...