https://school.programmers.co.kr/learn/courses/30/lessons/12940 class Solution { public int[] solution(int n, int m) { int[] answer = new int[2]; answer[0]=gcd(n,m); answer[1]=m*n/answer[0]; return answer; } int gcd(int a, int b){ if(a%b==0) return b; return gcd(b,a%b); } }
https://school.programmers.co.kr/learn/courses/30/lessons/12912 class Solution { public long solution(int a, int b) { long answer = 0; if(a>b) { int temp=a; a=b;b=temp; } for(;a
https://school.programmers.co.kr/learn/courses/30/lessons/12925 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr class Solution { public int solution(String s) { int answer = 0; int i=0; int minus=1; char[] c=s.toCharArray(); if (c[0]=='+') i++; else if(c[0]=='-'){ minus=-1; i++; } for(;i
https://school.programmers.co.kr/learn/courses/30/lessons/42888 import java.util.*; class Solution { public String[] solution(String[] record) { String[] answer; List inout = new ArrayList(); Map nickname= new HashMap(); //id , nickname 형태 for(int i=0;i
https://school.programmers.co.kr/learn/courses/30/lessons/12949 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr class Solution { public int[][] solution(int[][] arr1, int[][] arr2) { int[][] answer = new int[arr1.length][arr2[0].length]; for(int i=0;i
https://school.programmers.co.kr/learn/courses/30/lessons/12953 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr - 두 수의 최대공배수를 구한 후 이 수를 다시 다음 수와 최대공배수를 구하는 방식을 계속 반복... - 두 수의 최대공배수 = 두 수의 곱 / 두 수의 최대공약수 - 두 수의 최대 공약수는 유클리드 호제법으로 구했음 https://selfimprove39.tistory.com/entry/python-%EC%9E%AC%EA%B7%80%ED%98%B8%EC%B6%9C%EB%A1%9C-%EC%B5%9..
https://school.programmers.co.kr/learn/courses/30/lessons/87389 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr class Solution { public int solution(int n) { for(int i=2;i