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

How to be awesome

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

How to be awesome

검색하기 폼
  • 분류 전체보기 (145)
    • Java (32)
    • Algorithm (26)
    • JSP & Servlet (0)
    • Spring Framework (14)
    • Git & Github (6)
    • Database (11)
    • Linux (3)
    • Design Pattern (12)
    • JPA (7)
    • Project (14)
    • JavaScript (4)
    • Development (10)
    • HTML&CSS (1)
    • AWS (5)
  • 방명록

더 맵게 (1)
프로그래머스 알고리즘 - 더 맵게

프로그래머스 알고리즘 - 더 맵게 ☞ 프로그래머스 '더 맵게' 문제링크 음식 중에 가장 덜 매운 2가지의 음식을 반복적으로 선택해야 합니다. 우선순위 큐(Priority Queue)를 사용하면 가장 덜 매운 2가지 음식을 찾기 편합니다. 우선순위 큐에 대한 내용은 이전 포스팅에 있습니다. ☞ 우선순위 큐 - Java에서 다루기 풀이코드 (java) class Solution { public int solution(int[] scoville, int K) { int answer = 0; PriorityQueue priorityQueue = new PriorityQueue(); //우선순위 큐에 음식 담아주기 for (int i : scoville) { priorityQueue.add(i); } //가장 덜..

Algorithm 2019. 2. 14. 11:32
이전 1 다음
이전 다음

Blog is powered by Tistory / Designed by Tistory

티스토리툴바