햄버거만들기 (1) 썸네일형 리스트형 [TIL]2024-4-08 / 66일차 - 최종 프로젝트 6주차 1일차 1. 오늘의 알고리즘 코드카타 - 햄버거 만들기 답안 : //시간복잡도 주의 using System; using System.Collections.Generic; public class Solution { public int solution(int[] ingredient) { int answer = 0; List list = new List(); foreach(int burger in ingredient) { list.Add(burger); if(list.Count >= 4) { if(list[list.Count - 4] == 1 && list[list.Count - 3] == 2 && list[list.Count - 2] == 3 && list[list.Count - 1] == 1) { answer++.. 이전 1 다음