ALGORITHM ๐Ÿค–/Programmers

ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค
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"); } } }
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..
https://school.programmers.co.kr/learn/courses/30/lessons/12931 public class Solution { public int solution(int n) { int answer = 0; String s = Integer.toString(n); for(int i = 0; i < s.length(); i++){ answer += Integer.parseInt(s.substring(i, i+1)); } return answer; } }
daxx0ne
'ALGORITHM ๐Ÿค–/Programmers' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๊ธ€ ๋ชฉ๋ก (3 Page)