static int solution(string s) { int answer = 0; int firstCount = 0; int otherCount = 0; char first; first = s[0]; int i; //주어진 문자열 순회 for (i = 0; i < s.Length - 1; i++) { if (first == s[i]) //첫 글자와 같으면 firstCount +1 firstCount++; else //첫 글자와 다르면 otherCount +1 otherCount++; if (firstCount == otherCount) // 두 개의 카운터가 같을 경우 { firstCount = 0; otherCount = 0; answer++; first = s[i + 1]; //다음 글자를 첫 글..