개발일기/TIL(Since24.04.19)
Java&Spring -TIL(24.06.20 목)
w.llama
2024. 6. 21. 10:00
오늘 한 일
- Spring 팀과제 (댓글 CRUD 제작)
- 환경변수 설정법 ${변수명} IntelliJ - run - edit configuration - Modify options - Environment variables $ -
환경변수 추가 (mysql 이름,비밀번호)
- 환경변수 설정법 ${변수명} IntelliJ - run - edit configuration - Modify options - Environment variables $ -
- HyperSkill 문풀
- 프로그래머스 문풀
- 기사단원의 무기(Java)
- 년, 월, 성별 별 상품 구매 회원 수 구하기 (SQL)
프로그래머스
코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.
programmers.co.kr
풀이
class Solution {
public int solution(int number, int limit, int power) {
int[] count = new int[number + 1];
for (int i = 1; i <= number; i++) {
for (int j = 1; j <= number / i; j++) {
count[i * j]++;
}
}
int answer = 0;
for (int i = 1; i <= number; i++) {
if (count[i] > limit) {
answer += power;
} else {
answer += count[i];
}
}
return answer;
}
}
내일 할 일
Spring 과제 진행
HyperSkill/프로그래머스 문풀