https://school.programmers.co.kr/learn/courses/30/lessons/181932 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr class Solution { public String solution(String code) { String answer = ""; boolean mode = false; StringBuilder ret = new StringBuilder(); for(int i=0; i

class Solution { public int[] solution(int money) { int[] answer = new int[2]; int icedCoffee = 5500; answer[0] = money/icedCoffee; answer[1] = money%icedCoffee; return answer; } }

피자 조각이 7개 ! 사람이 7 명일 때는 1판 필요하고, 14판일 때는 2판 ... 8 명일 때는 2판이 필요하다. n이 7의 배수일 때는 n / 7 , 아닐 때는 ( n / 7 ) + 1 이 된다. 나머지 연산자를 이용 class Solution { public int solution(int n) { int answer = 0; if ( n % 7 == 0 ) { answer = n / 7 ; }else { answer = ( n / 7 ) + 1; } return answer; } }