카드뭉치 (1) 썸네일형 리스트형 [TIL]2024-2-29 / 47일차 - 심화 팀플 4일차 1.오늘의 알고리즘 코드카타 - 카드 뭉치 답안 : //복잡하게 생각해서 찾아보니 매우 간단했다. public class Solution { public string solution(string[] cards1, string[] cards2, string[] goal) { string answer = "Yes"; int index1 = 0; int index2 = 0; for(int i = 0; i < goal.Length; i++) { if(index1 < cards1.Length && goal[i] == cards1[index1]) { index1++; continue; } else if(index2 < cards2.Length && goal[i] == cards2[index2]) { index2++.. 이전 1 다음