https://school.programmers.co.kr/learn/courses/30/lessons/12969 import java.util.Scanner; class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); for(int i = 0; i < b; i++){ for(int j = 0; j < a; j++){ System.out.print("*"); } System.out.print("\n"); } } }
ALGORITHM ๐ค/Programmers
ํ๋ก๊ทธ๋๋จธ์คhttps://school.programmers.co.kr/learn/courses/30/lessons/12950 class Solution { public int[][] solution(int[][] arr1, int[][] arr2) { int[][] answer = new int[arr1.length][arr1[0].length]; for(int i = 0; i < arr1.length; i++){ for(int j = 0; j < arr1[0].length; j++){ answer[i][j] = arr1[i][j] + arr2[i][j]; } } return answer; } }
https://school.programmers.co.kr/learn/courses/30/lessons/70128 class Solution { public int solution(int[] a, int[] b) { int answer = 0; for(int i = 0; i < a.length; i++){ answer += a[i] * b[i]; } return answer; } }
https://school.programmers.co.kr/learn/courses/30/lessons/86491 class Solution { public int solution(int[][] sizes) { int x = 0; // ๊ฐ๋ก int y = 0; // ์ธ๋ก for(int i = 0; i x) { // ์ ํํ ํฐ ์ ์ค ๊ฐ์ฅ ํฐ ์๋ฅผ max๋ก x = max; } if(min > y) { // ์ ํํ ์์ ์..
https://school.programmers.co.kr/learn/courses/30/lessons/12982 import java.util.Arrays; class Solution { public int solution(int[] d, int budget) { int answer = 0; Arrays.sort(d); // ์ค๋ฆ์ฐจ์ ์ ๋ ฌ for(int i = 0; i = 0){ answer += 1; } else{ // ์์ฐ ๊ธ์ก๋ณด๋ค ํฌ๋ฉด ๋ฉ์ถค break; } } return answer; } }
https://school.programmers.co.kr/learn/courses/30/lessons/12932 import java.util.Arrays; class Solution { public int[] solution(long n) { String s = Long.toString(n); StringBuffer sb = new StringBuffer(s); String a = sb.reverse().toString(); String[] arr = a.split(""); int[] answer = new int[arr.length]; for (int i = 0; i < arr.length; i++) { answer[i] = Integer.parseInt(arr[i]); } return answer..