숫자 카드 게임

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine().trim(), " ");

        int N = 0, M = 0;
        N = Integer.parseInt(st.nextToken());
        M = Integer.parseInt(st.nextToken());
        
        String str = "";
        
        char[][] chararray = new char[N][M];
        
        for(int i = 0; i < N; i++){
            str = br.readLine();
            str = str.replace(" ", "");
            for(int j = 0; j < str.length(); j++){
                chararray[i][j] = str.charAt(j);
            }
        }
        
        
        char min = chararray[N-1][0];

        for(int i = 0; i < M; i++){
            if(min > chararray[N-1][i]){
                min = chararray[N-1][i];
            }
        }
        
        System.out.println(min);
    }
}

+ Recent posts