프로그래머스 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253package test; /* */ public class lv1숫자_문자열과_영단어 { public static void main(String[] args) { String s = "one4seveneight"; Solution2 solution2 = new Solution2(); solution2.solution(s); }} class Solution2 { public int solution(String s) { String[] words = new String[]{"zero", "one", "two", "three"..
import java.util.*; class Solution { public String solution(String[] participant, String[] completion) { Arrays.sort(participant); Arrays.sort(completion); int i = 0; for ( i = 0; i < completion.length; i++) { if (!participant[i].equals(completion[i])) { break; } } return participant[i]; } }
import java.util.*; class Solution { public String solution(String[] participant, String[] completion) { Arrays.sort(participant); Arrays.sort(completion); int i = 0; for ( i = 0; i < completion.length; i++) { if (!participant[i].equals(completion[i])) { break; } } return participant[i]; } }
import java.util.ArrayList; import java.util.Arrays; import java.util.List; class Solution { public String solution(int[] numbers, String hand) { List listNumbers = new ArrayList(); int X1_L = 0; int Y1_L = 3; int X1_R = 2; int Y1_R = 3; for (int i = 0; i < numbers.length; i++) { if (numbers[i] == 1 || numbers[i] == 4 || numbers[i] == 7) { listNumbers.add("L"); switch (numbers[i]) { case 1: X1_L..
import java.util.Arrays; class Solution { public int[] solution(int[] lottos, int[] win_nums) { Arrays.sort(lottos); Arrays.sort(win_nums); int count = 0; int zeroCount = 0; int rank = 0; System.out.println("win_nums = " + Arrays.toString(win_nums)); System.out.println("lottos = " + Arrays.toString(lottos)); for (int i = 0; i < lottos.length; i++) { if (lottos[i] != 0) { for (int j = 0; j < win_..
https://www.acmicpc.net/problem/9095 9095번: 1, 2, 3 더하기 각 테스트 케이스마다, n을 1, 2, 3의 합으로 나타내는 방법의 수를 출력한다. www.acmicpc.net import java.util.Scanner; public class Main { public static void main(String[] args) { int dp[] = new int[11]; //최대 11까지만 한다고 했으니까. Scanner sc = new Scanner(System.in); int t = sc.nextInt(); dp[1] = 1; //초기값의 초기화 dp[2] = 2; dp[3] = 4; for (int i = 4; i