프로그래머스/JAVA21 [해시] 위장 1234567891011121314151617181920212223242526272829303132333435363738394041424344import java.util.*; public class camouflage { public int solution(String[][] clothes) { int answer = 1; int count=1; Mapspy=new HashMap(); if(clothes.length 2018. 10. 12. [해시] 전화번호 목록 12345678910111213141516171819202122232425262728293031323334import java.util.*; public class phoneNumberList { public boolean solution(String[] phone_book) { // Arrays.sort(phone_book, new Comparator() {//Comparator 구현// @Override// public int compare(String o1, String o2) {// return Integer.compare(o1.length(),o2.length());// }// }); // Arrays.sort(phone_book, (o1, o2) -> Integer.compare(o1.leng.. 2018. 10. 10. [정렬] H-Index 123456789101112131415161718192021222324252627282930import java.util.*; public class HIndex { public int solution(int[] citations) { int answer = 0; Vector cit=new Vector(); addElement(citations, cit);//벡터에 원소 추가 cit.sort(new comp());//역순 정렬 answer = getHInex(answer, cit); return answer; } public int getHInex(int answer, Vector cit) { while ((answer=answer+1)){ answer++; } return answer; } public.. 2018. 10. 5. [해시] 완주하지 못한 선수 1234567891011121314151617181920212223242526272829303132333435363738394041424344import java.util.HashMap;import java.util.Map; public class NotFinishRace { public String solution(String[] participant, String[] completion) { String answer = ""; Mapinfo=new HashMap(); InsertPartInfo(participant, info);//참가자 정보를 해시맵에 넣었다. FindNotComplete(completion, info);//완주하지 못한 참가자를 찾았다. answer = GetAnswer(answe.. 2018. 10. 4. 이전 1 2 3 4 5 6 다음