슈콩

[SWEA] 화섭이의 정수 나열 본문

Algorithms/SWEA

[SWEA] 화섭이의 정수 나열

shukong 2025. 11. 15. 15:53

 

 

[문제] 

https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWHz7xD6A20DFAVB

 

SW Expert Academy

SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!

swexpertacademy.com

 

 

[소스 코드]

import java.io.*;
import java.util.*;
public class Solution {
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		int T = Integer.parseInt(sc.next());
		for(int tc=1;tc<=T;tc++) {
			int n = Integer.parseInt(sc.next());
			String str = "";
			for(int i=0;i<n;i++) {
				str += sc.next();
			}
			int num = 0;
			while(true) {
				if(!str.contains(String.valueOf(num))) break;
				num++;
			}
			System.out.println("#"+tc+" "+num);
		}
	}
}

'Algorithms > SWEA' 카테고리의 다른 글

[SWEA] 무한 문자열  (0) 2025.11.15
[SWEA] 팰린드롬 문제  (0) 2025.11.15
[SWEA] 공평한 분배 2  (0) 2025.11.15
[SWEA] 사랑의 카운슬러  (0) 2025.11.15
[SWEA] 신뢰  (0) 2025.11.15