본문 바로가기 메뉴 바로가기

kirinmanDevBlog

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

kirinmanDevBlog

검색하기 폼
  • 분류 전체보기 (115)
    • language (32)
      • java (15)
      • python (14)
      • c# (3)
    • db (9)
      • sql (8)
      • redis (1)
    • 알고리즘 문제 (12)
    • Learned! (29)
    • git (5)
    • spring (19)
    • diary (2)
    • web (4)
  • 방명록

프로그래머스 (5)
[프로그래머스] 베스트앨범

[문제 링크] https://school.programmers.co.kr/learn/courses/30/lessons/42579 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr public class Quiz05 { public static void main(String[] args) { String[] genres = {"classic", "pop", "rock", "classic", "rock", "metal", "jazz"}; int[] plays = {1000, 600, 300, 1000, 500, 1000, 700}; hashing(genres, ..

알고리즘 문제 2023. 4. 14. 21:55
[프로그래머스]전화번호 목록 - JAVA

[문제 링크] https://school.programmers.co.kr/learn/courses/30/lessons/42577 import java.util.Arrays; import java.util.HashSet; class Solution { public boolean solution(String[] phone_book) { HashSet set = new HashSet(Arrays.asList(phone_book)); boolean answer = true; for (String phoneNumber : phone_book) { for (int i = 1; i < phoneNumber.length(); i++) { if (set.contains(phoneNumber.substring(0, i))..

알고리즘 문제 2023. 4. 13. 17:14
[프로그래머스] 폰켓몬 - JAVA

[문제링크] https://school.programmers.co.kr/learn/courses/30/lessons/1845 import java.util.HashSet; class Solution { public int solution(int[] nums) { //겹치지 않는 최대의 경우를 생각하면 일단 겹치는 애들이 없는 경우를 만들어야 함 HashSet answerArr = new HashSet(); for (int num : nums) { answerArr.add(num); } int answer = 0; //어짜피 최고로 많은 종류가 오는 경우는 nums를 2로 나눈 만큼 오는 게 최대 //그게 아니라면 set의 크기를 리턴하면 됨 -> 이게 겹치지 않는 최대 숫자니까 if (answerArr...

카테고리 없음 2023. 4. 13. 16:43
[프로그래머스] 위장 - JAVA

[문제 링크] https://school.programmers.co.kr/learn/courses/30/lessons/42578 import java.util.*; class Solution { public int solution(String[][] clothes) { HashMap hashMap = new HashMap(); for (String[] cloth : clothes) { //만약 해시에 키가 없으면 1개로 카운트 해서 추가 if (!hashMap.containsKey(cloth[1])) { hashMap.put(cloth[1], 1); //해시에 키가 존재하면 이전 카운트에 1 추가 } else if (hashMap.containsKey(cloth[1])) { hashMap.put(clot..

알고리즘 문제 2023. 4. 13. 16:35
[프로그래머스] 로또의 최고 순위와 최저 순위 자바

이번에는 나름 레벨업을 해 보고자 stream을 적극 사용하고자 하였다. 먼저 접근 전략은 1. 최저로 맞힌 갯수 는 0의 여부와는 상관없으니, 기존에 있는 숫자들로 계산한다. 2. 최고로 맞힌 갯수는 0이 무조건 맞는 숫자인 경우라고 생각하면 되니까, 최저 등수에 0의 갯수를 더해준다. 3. 7에서 맞힌 갯수를 빼면 등수가 나오는데 다 틀린 경우, 즉 맞힌 갯수가 0이어서 7이 될때도 6등이 되어야 하니 이 부분만 따로 예외 처리를 해 준다. stream을 0의 갯수를 찾을 때 사용해 봤는데, 확실히 for문 쓰는 것 보다야 코드가 간결해 지는 것 같다. 먼저 0의 갯수를 cnt라고 하고, lottos를 리스트로 변환한다. 그리고 lottos와 win_nums를 비교해서 같은 숫자가 있는지를 보는 것이..

알고리즘 문제 2022. 12. 18. 18:07
이전 1 다음
이전 다음
공지사항
  • Developer from Filmmaker!
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • bankersRounding
  • 인덱스
  • Java
  • jmeter토큰
  • CheckedException
  • CorrectnessAndTheLoopInvariant
  • Python
  • jmeter로그인
  • jmeter테스트
  • jwt
  • index
  • Redisson
  • EC2
  • jmeter세션
  • 스프링faker
  • 부하테스트시나리오
  • pessimisticlock
  • Redis
  • 토큰
  • 동적크롤링
  • Lock
  • jmeter쿠키
  • 자바
  • hackerrank
  • 항해
  • Spring
  • jmeter부하테스트
  • 프로그래머스
  • jmeter시나리오
  • 대규모더미데이터
more
«   2025/05   »
일 월 화 수 목 금 토
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
글 보관함
  • 분류 전체보기 (115)
    • language (32)
      • java (15)
      • python (14)
      • c# (3)
    • db (9)
      • sql (8)
      • redis (1)
    • 알고리즘 문제 (12)
    • Learned! (29)
    • git (5)
    • spring (19)
    • diary (2)
    • web (4)
  • 방명록
  • GitHub

Blog is powered by Tistory / Designed by Tistory

티스토리툴바