From 2150f03842a5c5ba88dca7470dc62dd66dc670cb Mon Sep 17 00:00:00 2001 From: seohs Date: Mon, 16 May 2022 19:31:31 +0900 Subject: [PATCH 1/7] init --- .classpath | 10 + .project | 17 + bin/codingTest/Animal.class | Bin 0 -> 489 bytes bin/codingTest/Card.class | Bin 0 -> 356 bytes bin/codingTest/Eatable.class | Bin 0 -> 210 bytes bin/codingTest/Person.class | Bin 0 -> 378 bytes bin/codingTest/Solution$1.class | Bin 0 -> 1389 bytes bin/codingTest/Solution$2.class | Bin 0 -> 1187 bytes bin/codingTest/Solution$3.class | Bin 0 -> 1271 bytes bin/codingTest/Solution$4.class | Bin 0 -> 1741 bytes bin/codingTest/Solution.class | Bin 0 -> 15797 bytes bin/codingTest/module.class | Bin 0 -> 6093 bytes bin/module-info.class | Bin 0 -> 149 bytes src/codingTest/Animal.java | 10 + src/codingTest/Eatable.java | 8 + src/codingTest/Person.java | 12 + src/codingTest/module.java | 857 ++++++++++++++++++++++++++++++++ src/module-info.java | 2 + 18 files changed, 916 insertions(+) create mode 100644 .classpath create mode 100644 .project create mode 100644 bin/codingTest/Animal.class create mode 100644 bin/codingTest/Card.class create mode 100644 bin/codingTest/Eatable.class create mode 100644 bin/codingTest/Person.class create mode 100644 bin/codingTest/Solution$1.class create mode 100644 bin/codingTest/Solution$2.class create mode 100644 bin/codingTest/Solution$3.class create mode 100644 bin/codingTest/Solution$4.class create mode 100644 bin/codingTest/Solution.class create mode 100644 bin/codingTest/module.class create mode 100644 bin/module-info.class create mode 100644 src/codingTest/Animal.java create mode 100644 src/codingTest/Eatable.java create mode 100644 src/codingTest/Person.java create mode 100644 src/codingTest/module.java create mode 100644 src/module-info.java diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..0df9019 --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + codingTest + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/bin/codingTest/Animal.class b/bin/codingTest/Animal.class new file mode 100644 index 0000000000000000000000000000000000000000..e39fcc61116a82a78a0d81eb9bba01e997edb641 GIT binary patch literal 489 zcmZXQ&rZTX5XQe@TPURp6#RekV!%Wj^$0OBCZ32MAl$cQgNvn2%HnfrJeYX!0emRq zZmE&TCX=0+o!`ti`}O_t3806g3QB}#lul$a9f^esZW1}?aRnBkG2_oXhST3 z6v1Ao?BbH(5B}bUD${U};Pj(dCQ@A!Sf@KCShwj!IH(cmstUrE2ODKVeIOHYznq66 z8}Tp}re7NIc+4|t;v!k@=iOW|_#PT?bVv0l7lhVeL$RK3DIPx&+MVvEItTj%&lLO` z!5yZ{EE0FpD5$L#KR0_>$674YA4I4c#oA+VP|;>Gz=^)iDf{jlyjSg&ux;WzZ=;@P z46jueOrUQ=*{APl{zq7jc&h@m(AI^(4t5Lptbm!n_o5%xr#WjVD^S8gUUm2bvwu@% literal 0 HcmV?d00001 diff --git a/bin/codingTest/Card.class b/bin/codingTest/Card.class new file mode 100644 index 0000000000000000000000000000000000000000..6d014711faed61ff5e1050b7efc92912dcc6c7f3 GIT binary patch literal 356 zcmZ8d!AiqG6r4?BQ`4wv)VAQoW7~uIfQpxbPzVZIa(0s}bxWE+n)JU^MDXAT_)+4l zdU9dsy`8ti%@1u(YD#nv!A9V2HqGP(gk3DqA#JW^B?IuO0q?$Q>r7p1Bkpagye-s)35|35*nFSG5Hw>4 zV^0*^U6>pmyF1>nSi|WXdegI496lp(9$pYUk+l$-864s%aX{S=eT;BSX7H=T31?=7 MKMwpIPKMa%(FVaIsqdV}i8l+gu&WS`otU^UWvR6&kj*BrGw4E7KEY!3RmV L0F%KBhh6jrsqin$ literal 0 HcmV?d00001 diff --git a/bin/codingTest/Person.class b/bin/codingTest/Person.class new file mode 100644 index 0000000000000000000000000000000000000000..ab2460a1cbb1cf01c376e50d811b97042e32cbda GIT binary patch literal 378 zcmYjNOHRWu6r7i&2~7i~X)nO8MTi`rh)o5ns35iK-btb%7 literal 0 HcmV?d00001 diff --git a/bin/codingTest/Solution$1.class b/bin/codingTest/Solution$1.class new file mode 100644 index 0000000000000000000000000000000000000000..513a042f9811fa45457141a10a5ad4e5e7f22578 GIT binary patch literal 1389 zcma)6TTc@~6#ix@EG>&v?%u0b=#^5$YY~MCQmtT8ATd5I?FdV@JI!85`~^PfyMMwL zO)N$esRGpzk>?zp*%Fg@20 zRy?mF#1K8ykMx|WTl=}Ky+dAgRSYnUx2)u6=8B@;&~4onHp75>U^wx40xSn07RX`A zunc#ZVLB1$k=$hn6-AAQ!7!{r#b5+|7|{?$l%X#n9Y)HA#W%hB9=EskJ(DwxmPJ)J zcXiv4&%QAv$uLX>1&Zg1j9P6`r~9*s@=2N%*Cs6ry_RGtjA@)#aqg5Xl{b#d>l!ZL zA~6)6E7Nbm86x+Buv|jqdcC0HGSTS{wCWjVjoT5#a81S4)6gv{8m=QwbdPk?<6Ey8 zW;*G%t5Qhz@{QmUW~6en#HjO%pJ8%WdL%WZkfze;jRv=B4A~&p9(12}K|*9T%pu1x z=!!NpHAo_mPz-qu3%JP;_Ql^8{~%Y2;1=$vxXmyYpr(eqxJRNiq`;;{ZIdX;=1@dl z_CvSIRBlBqbXD4yuEY7Sm=v7hp@s=eGDIrEv#WgFkgYaU7d6l1b20#BQ8D%{-Suqx zXQ>ybZRr}5PCvgA%S3Nv&8nKhq1JoO-2+imu}+x>jFE;7l!%q%4{Dy&oJ_nb1qjZd zl`MKJD} z(UXF+^gBR4P~Kvc&YC>atuc(#PSwPukMM!eCFag&Ont|tmzl4)a*P}4CK63#q$S<9 zWZIS{=9^gjPtT78+$Ix|G?jPAD(_o_V(p+lAqtQC^rn*}cd$e!CAvZ+ANVA*3~2*81{JzuAc15O zF^n2WVT>V`Q>y8j?OOZo){*5Mh$F{h7^z89IETWs)xIaxR3;3QQBhub#Y<;O4xP=)Cv1tVia}k93enyqs9RqifrMg)!+QOlL$D?eY z>X`d`XJM4RJEL?{m_^P&9tDO(FQo(dAD&$XE|*osE;j`ggv$y|9XjS6LPPaHn9u1} zdj(C_W!p2Y$F?eYswEq3$68c0DU>Nj!-OiB9J-gt$9(Y7j%}2->j9u5YylqGLzC|@3+^2W5BmDp~ z)Oax(1K^pA>O>$jqWX~D8mEzhL8n86)@dK3HC-s4VYpB_L#FT!BX2^*ahl_#2>t~V zgq0DgViH$rWthUX9?dJF86eq8;Vm-7b6nq7phRFpTbR<$ar-5Pi=QxCdXIUI*Haqd zg)Szu7?i6CMZv!!!M|aYf5$ZcLCQZv*Q;Ino@;W1B1&O6D_9`JDZ2s|3DHBN{L6$i sED>u8>=)*B#ONcEWfE~zh(N8YxJRpoH9Vl75U4;bBqfMV8XRkX0QPVe3;+NC literal 0 HcmV?d00001 diff --git a/bin/codingTest/Solution$3.class b/bin/codingTest/Solution$3.class new file mode 100644 index 0000000000000000000000000000000000000000..578bfe7f228669b22b0f02a53b6dc82578ca4d9b GIT binary patch literal 1271 zcmZuxTT|0O6#g~|1lm9=SGiPBtF$RlZlYK$U0lJX1uIled} ziat0#`=cDsrqNbtXHNF)xqj!e{q_6%4*&(c)}b(r*WHHYG*5&dr{lS^#r&lOorANd9L+p~<>41Ap z5iqbad2Cyb6%-k!GCf_&*;59s7SI+c00oChaS>(TvsdQRU4Ls^o;kG1Oj$sz} zbfgGd$G+?YqA5HBbC_ospho$EWYnM@QDuw=Nb7jWFx-i8$b&NjkMNjku0dw{&;DDncC;7`__={8Ow-0x-IiAu2bP>={K9Rt zY_TlU6W*%Tba>G6NV9!AdRua1N4xDJ=tUZLV&AFTu1~W)6v3I>(6Prb+GB?el<||5Z@aQbQOnsLLI$JkIKnI0-1h~Ia^Q%b+#A;qFi$nBM14?_Nx9`fazySp zJyVq^4uiBq#BD(dB?&Wkg<*5{3Q6-TMm~{B!8m>U$q?!kCWx0#KmwDvOD8=uOh;ip zkaZu)O!G66xogZcu5rI8FN@J-Q%hZAVO*onH{=w2BU)nfr;Si$q_r)kzwbMW(VW ig{Y7Iz9hGe7vWjN4xJiy@e=#Q$t{w_%ijT!g55tyX&kfw literal 0 HcmV?d00001 diff --git a/bin/codingTest/Solution$4.class b/bin/codingTest/Solution$4.class new file mode 100644 index 0000000000000000000000000000000000000000..47e733aa06ec2614ef162c660cd1f0c44f10e429 GIT binary patch literal 1741 zcma)7U02&i5WQ>378p?+6G#YLJAm^Bqmp%!j8l^(wNOI0; z|4jctUi#29?L$wV`=i?4l^3EEJz#sK+1c5dyLV>RfB*C6UjUleH;@sS8~8_#H$1Sz zsNVP8QRMhusbN4DD7>;>TXom+hV}i!SN0$>kQ2BXYiZ}!+y2R^6*Z97%1Z&g?H}2b5STV$U?L9)4*pRWqgc3j}lf4e0~-scGC4CduRtH?xHL(!4e2<>X`auC`Ew8 zTqS1DIw9r~R!!W)eP-ab<&NzA9|Y#h-6S66y*Y(7JTS0+R&jA?RdLL;i7(J#N>m~b z{Qrel$C7Ew_;fOxl2f_#Kp-pmq=}$yEK8llOIjE4*=^tG2l05nAl8nP=X>^+R^Rt{olwM+V64Y|6!8;yd&RI8;~98ac0&zfXWv ztamFZN&&O$d3MlttuVCN@e_Nz$2xu(;TGx8II<9hg1k(4=V=_1kVH*UY9PZekgwK$ zgIWC@pZv;M23PpZ(FR%_Marg>xoZ|z`DU46o>tc=XK-D55_w7n=Pzo-g|}FIkK6BX zr?r}xZ0NOOWxTYNT|F0b%X9iKC@#N4ZBFOo57aYwvyffLjV1cjV>~ydf31OO?I9Mm z4XkLJSl70&sWq{qJ&tj9#uyY%qQOIK#Mob8lTrrLXyZ#fA`gpP+oGgn1y%kRY?G&T z-Wrc7<?tzG+uT@*OuG-qxXREfgt@gFnTCG~<|2yBkGr7UgzQ4lEH{W`` zv;59-FV7u$^e_?CtCKBKOvNq9*7mNgYZB?6=}pOw-k$bkmqjL1_`LY}@#!7$uC3D> zH=mbi>0$EEZ|`dFS;%Beowk$f2UC$IuyJXD7iBmT=OxxIC(Fp9W2?B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Wie6v`p%2z`j0WWU<553dz3ycNE^^59#~N;!lh&BX`s`hL6>{#PH~ z?ZbciFtAT}imUpBZ%r>IRb(rxPx$LdSF&&?w2}iN$O}~`FUq{MRh~t$U{r#PNFF0m zz(|zh8LYswsK;~s_r^2K%NJZ`Y+#N_Ggfey$R9ML5Z*lLRj=dXiHx|OHAgI?IeyaY zaLTWtoEES*$ojJl>qTdIzZj(&0@YsX7&>VrLnlc?Yka+!6JcMmn+R!^k<(&qt(ijZi^@F&Yvt=~Fu^H610%SOmh1o0A^=F42~USa!u6=e+9N(O2p!(!5s&3Fx4 z`1vy4UxU|`N9L%2?+^vbBSF^h)69DQBM-KhJfw~&FL_ml%bB6DM4=P@8Sov$Bn>wY zu!A!VxK-InIBS6M@JIl)6JiXj+MX`2GJ)jqTFxdr$rr8m_safSH z8Pmjgo&u^43gCO69YGvJSQNeoe_=?j6OPRld`re2RcszrZ1yb9C{^rP?BN)E3Lqty z4u^84L+LN(%(_Ria1rxspn^ye?j#OL6>+4nAak&|PfU`j;-%S_D;4FULY?M{`C@@ORf)x-S}Y-!T!u~&HKGoY{{pkO{Y(G= literal 0 HcmV?d00001 diff --git a/bin/module-info.class b/bin/module-info.class new file mode 100644 index 0000000000000000000000000000000000000000..845d9c6614d1e9614c4e81f6c28920d1dd93cd5c GIT binary patch literal 149 zcmX^0Z`VEs1_o;eE_MbcMh5QO{FKt1RNc(Hw0uSeuHgLAqU2P!%$!t41_2}~y{yEt zL`DWSU$AOn26mv@ System.out.println(t)); +// +// int ans = 0; +// ans = s.solution00(new int[] {20,40,65,110}, 30); +// System.out.println(ans); + + // + + + + + //dfs, bfs +// Scanner sc = new Scanner(System.in); +// int n = sc.nextInt(); +// int m = sc.nextInt(); +// int start = sc.nextInt(); +// a = (ArrayList[]) new ArrayList[n+1]; +// for (int i=1; i<=n; i++) { +// a[i] = new ArrayList(); +// } +// for (int i=0; i true); //Stream filter + //Stream filter ó list ȯ + //ArrayList alreadyRankUser = (ArrayList) rankList.stream().filter(t -> t[0].equals(userName) && Integer.parseInt(t[1]) >= userScore).collect(Collectors.toList()); + + //=========================================================== + + + List list = new ArrayList(); + + + list.add(new Integer[][] {{1,3}}); + + //arrayList + List list1 = new ArrayList(); + int index = 0; + list1.add(index, 0); + list1.remove(index); + for (Integer integer : list1) { + System.out.println(integer); + } + + + //=========================================================== + + //map + HashMap map = new HashMap(); + + HashMap> ma2 = new HashMap>(); + + //ma2.put("aa", new List); + + for(String key : map.keySet()) { + + } + + //=========================================================== + + //Stack + Stack stack = new Stack(); + stack.add(null); //ֱ + stack.empty(); // Ȯ + stack.peek(); //stack ֻ + stack.pop(); //stack + + //Queue + Queue queue = new LinkedList<>(); + queue.add(null); //ֱ + queue.isEmpty(); // Ȯ + queue.peek(); //queue + queue.poll(); //queue + + + //Ÿ + //int[] integer[] ٲٴ + Integer[] arr2 = Arrays.stream( arr ).boxed().toArray( Integer[]::new ); + + //forEach + Arrays.stream(arr).forEach(s -> System.out.println(s)); + + //ѱھ split -- Ķ "" + String str = "12345"; + String[] result = str.split(""); + + //binarySearch + Arrays.binarySearch(result, "1"); + PriorityQueue q = new PriorityQueue(); + + // + /* + String[] result = new String[numbers.length]; + for (int i = 0; i < numbers.length; i++) { + result[i] = String.valueOf(numbers[i]); + } + + // + Arrays.sort(result, new Comparator() { + + @Override + public int compare(String o1, String o2) { + + return ((o2 + o1).compareTo(o1 + o2)); + } + }); + */ + + + } + public static boolean isPrime(int num){ + for(int i=2; i<=num/2; i++){ + if(num % i == 0) return false; + } + return true; + } + + + static ArrayList[] a; + static boolean[] c; + public static void dfs(int x) { + if (c[x]) { + return; + } + c[x] = true; + System.out.print(x + " "); + for (int y : a[x]) { + if (c[y] == false) { + dfs(y); + } + } + } + public static void bfs(int start) { + Queue q = new LinkedList(); + q.add(start); + c[start] = true; + while (!q.isEmpty()) { + int x = q.remove(); + System.out.print(x + " "); + for (int y : a[x]) { + if (c[y] == false) { + c[y] = true; + q.add(y); + } + } + } + } + + public boolean BinarySearch(int []arr, int len, int key){ + int start = 0; + int end = len-1; + int mid; + + while(end - start >= 0) { + mid = (start + end) / 2; //߾ + + if (arr[mid] == key) { //key ã + return true; + + } else if (arr[mid] > key) { //key mid () + end = mid - 1; + + } else { //key mid Ŭ () + start = mid + 1; + + } + } + return false; + } +} + + + + + + + +class Solution { + + /** + * + * @author hs + * @ - ֽ ...... 𸣰ٴ + * + */ + public int[] solution1(int[] prices) { + + Stack stack = new Stack<>(); + int[] ret = new int[prices.length]; + + for (int i = prices.length - 2; i >= 0; i--) { + int day = 0; + + while (!stack.isEmpty() && stack.peek()[0] >= prices[i]) { + day += stack.pop()[1]; + } + + ret[i] = stack.push(new Integer[]{prices[i], day + 1})[1]; + } + + return ret; + } + + public int solution2(int bridge_length, int weight, int[] truck_weights) { + + int answer = 0; + + Queue queue = new LinkedList<>(); + int currentWeight = 0; + + for(int t: truck_weights){ + while(true) { + if(queue.isEmpty()){ + queue.add(t); + currentWeight += t; + answer++; + break; + } else if(queue.size() == bridge_length){ + currentWeight -= queue.poll(); + } else { + if(currentWeight + t > weight){ + queue.add(0); + answer++; + } else { + queue.add(t); + currentWeight+=t; + answer++; + break; + } + } + } + } + answer = answer + bridge_length; + + return answer; + } + + public int solution3(int[] A , int[] B) { + int answer = 0; + + Arrays.sort(A); + Integer[] arr = Arrays.stream( B ).boxed().toArray( Integer[]::new ); + + List list = Arrays.asList(arr); + + Arrays.sort(arr, Collections.reverseOrder()); + for (int i = 0; i < B.length; i++) { + B[i] = arr[i]; + System.out.println(B[i]); + } + + for(int i = 0; i< A.length; i++){ + answer += (A[i] * B[i]); + } + + return answer; + } + + public String solution4(String s) { + + String answer = ""; + + String[] stringArr = s.split(" "); + + int max = Integer.MIN_VALUE; + int min = Integer.MAX_VALUE; + + for(String str: stringArr) { + int num = 0; + + if(str.contains("-")) { + num = (-1) * Integer.parseInt(str.replace("-", "")); + } else { + num = Integer.parseInt(str); + } + + if(num > max) { + max = num; + } + + if(num < min) { + min = num; + } + } + + return answer; + } + + public String[] solution5(String[] record) { + + HashMap uidMap = new HashMap(); + + String[] answer = {}; + String answerStream = ""; + for(String str : record) { + String[] messageContent = str.split(" "); + String postFix = ""; + if(messageContent[0].equals("Leave")){ + postFix = "ϴ."; + } else if(messageContent[0].equals("Change")) { + uidMap.replace(messageContent[1], messageContent[2]); + } else { + postFix = "Խϴ."; + uidMap.put(messageContent[1], messageContent[2]); + } + + if(!messageContent[0].equals("Change")) { + answerStream += messageContent[1]+" "+ postFix + ", "; + } + } + + for( String key : uidMap.keySet() ){ + System.out.println(uidMap.get(key)); + System.out.println(answerStream); + String reg = key.toString(); + answerStream.replaceAll(key, uidMap.get(key)); + } + + answer = answerStream.split(","); + + return answer; + } + + public int[] solution6(int m, int n, int[][] picture) { + int numberOfArea = 0; + int maxSizeOfOneArea = 0; + TreeMap map = new TreeMap<>(); + + int[] answer = new int[2]; + answer[0] = numberOfArea; + answer[1] = maxSizeOfOneArea; + + for(int x = 0; x < m; x++) { + for(int y = 0; y < n; y++) { + + if(picture[x][y] != 0) { + + } + } + } + + + return answer; + } + + public String solution7(String number, int k) { + + String answer = ""; + String[] arr = number.split("\\[0-9]{1}"); + + Arrays.stream(arr).forEach(s -> System.out.println(s)); + + + return answer; + } + + public int solution8(String s) { + int answer = 0; + + HashMap aMap = new HashMap<>(); + String[] str = s.split(""); + + for(int i = 0; i < str.length ; i++) { + if(!aMap.containsKey(str[i])) { + aMap.put(str[i], 0); + } else { + aMap.replace(str[i], aMap.get(str[i]) +1 ); + } + } + + for(String key : aMap.keySet()) { + if(aMap.get(key) % 2 == 1) { + answer++; + } + } + + System.out.println(answer); + return answer; + } + + public String solution9(int n) { + String answer = ""; + String[] str = new String[3]; + int[] b = new int[9999999]; + str[0] = "4"; + str[1] = "1"; + str[2] = "2"; + + int i = 0; + while(n > 0){ + int remainder = n % 3; + n /= 3; + + if(remainder == 0) n--; + + answer += str[remainder] + answer; + } + + return answer; + } + + public int solution10(int n) { + int answer = 0; + + int[] clapChecker = new int [n+1]; + + for(int i = 1 ; i <= n; i++) { + String v = Integer.toString(i); + System.out.println(i+" : " + v.matches(".*[369].*")); + + if(v.matches(".*[369].*")) { + clapChecker[i] = 1; + } else { + clapChecker[i] = 0; + } + } + + answer = Arrays.stream(clapChecker).sum(); + + return answer; + } + + public int solution11(int[] success) { + int answer = Integer.MAX_VALUE; + HashMap map = new HashMap(); + + for(int i = 0; i < success.length; i++) { + if(map.containsKey(Integer.toString(success[i]))) { + int[] org = map.get(Integer.toString(success[i])); + if(org[1] == -1) { + org[1] = i; + map.replace(Integer.toString(success[i]), org); + } + } else { + map.put(Integer.toString(success[i]), new int[] {i,-1}); + } + } + + for (String key : map.keySet()) { + int[] a = map.get(key); + System.out.println(key + " / " + a[0] + ": "+ a[1]); + if(a[1] != -1) { + answer = answer > a[1]-a[0] == true ? a[1] - a[0] : answer; + } + } + + if(answer == Integer.MAX_VALUE) { + answer = -1; + } + + return answer; + } + + public int solution99(int k, String[] user_scores) { + + int answer = 0; + + LinkedList rankList = new LinkedList(); + String[] snapShot = new String[k]; + for(int i = 0; i < k; i++) { + rankList.add(new String[] {" ","0"}); + } + + //K 1̻ 100 ڿ + //user_scores ̴ 1 ̻ 1000 + //user_scores -> г + //ٲ -> г + int z = 0; + for(String s : user_scores) { + //ũ + for(int i = 0; i < k; i++) { + String[] rankUser = rankList.get(i); + snapShot[i] = rankUser[0].toString(); + } + + //о ĵ + String[] user = s.split(" "); + String userName = user[0]; + int userScore = Integer.parseInt(user[1]); + + if(rankList.size() == 0) { + rankList.add(user); + } else { + for(int i = 0; i < k; i++) { + String[] rankUser = rankList.get(i); + int rankUserScore = Integer.parseInt(rankUser[1]); + + if(rankUserScore < userScore) { + + //ũ ̹ ִ -> ũ ش. + boolean needRemove = false; + int removeIndex = -1; + for(int j = 0; j < k; j++) { + String[] tmpUser = rankList.get(j); + int tmpRankUserScore = Integer.parseInt(tmpUser[1]); + + + if(tmpUser[0].equals(userName) && tmpRankUserScore < userScore) { + needRemove = true; + removeIndex = j; + break; + } + } + + if(needRemove) { + //System.out.println("needRemove" + removeIndex); + rankList.remove(removeIndex); + rankList.add(i, user); + } else { + ArrayList alreadyRankUser = (ArrayList) rankList.stream().filter(t -> t[0].equals(userName) && Integer.parseInt(t[1]) >= userScore).collect(Collectors.toList()); + + //alreadyRankUser.forEach((t) -> {System.out.println(t[0]);}); + if(alreadyRankUser.size() == 0) { + rankList.add(i, user); + } + } + //rankList.remove(k); + break; + } + } + + } + + //ũ + for(int i = 0; i < k; i++) { + String[] rankUser = rankList.get(i); + if(!snapShot[i].equals(rankUser[0].toString())) { + answer++; + break; + } + } +// System.out.println("========================= i : " + z++); +// rankList.forEach((t) -> { +// System.out.println(t[0] + "/ "+ t[1]); +// }); +// +// +// System.out.println("========================="); +// + } + + return answer; + } + + // + public String solution13(int[] numbers) { + + // ڸ ڿ ȯ + String[] result = new String[numbers.length]; + for (int i = 0; i < numbers.length; i++) { + result[i] = String.valueOf(numbers[i]); + } + + // + Arrays.sort(result, new Comparator() { + + @Override + public int compare(String o1, String o2) { + System.out.println((o2 + o1).compareTo(o1 + o2)); + return ((o2 + o1).compareTo(o1 + o2)); + } + }); + + // 0 ִ 迭 ϳ 0 + if(result[0].equals("0")) { + return "0"; + } + + String answer = ""; + // ĵ ϳ ġ + for (String a : result) { + answer += a; + } + return answer; + + } + + public int solution14(int[] people, int limit) { + + //Ʈ յڷ ¿ ----- Ž + int answer = 0; + + Arrays.sort(people); + + int right = people.length - 1; + int left = 0; + + while (right >= left) { + int weight = people[right--]; + if (weight + people[left] <= limit) { + left++; + } + answer++; + } + + return answer; + } + + public int solution15(String name) { + int answer = 0; + String[] arr = name.split(""); + int[] resetStack = {1,2,3,4,5,6,7,8,9,10,11,12,13,13,12,11,10,9,8,7,6,5,4,3,2,1}; + int currentPoint = 0; + + for(int i = 0; i < arr.length ; i++) { + int targetPoint = arr[i].codePointAt(0)-65; + System.out.println("move To :" + arr[i]); + System.out.println(Math.abs(targetPoint-currentPoint)); + System.out.println(resetStack[targetPoint]); + answer += Math.min(Math.abs(targetPoint-currentPoint), resetStack[targetPoint]); + if(i != arr.length-1) { + answer++; + } + } + + return answer; + } + + + public String[] solution(String[] movie) { + + String[] ans = {}; + HashMap map = new HashMap(); + + for (String m : movie) { + if(map.containsKey(m)) { + Integer orgCount = map.get(m); + map.replace(m, orgCount+1); + } else { + map.put(m, 1); + } + } + + List tmpList = new ArrayList(); + + tmpList.addAll(map.keySet()); + + Collections.sort(tmpList,new Comparator() { + public int compare(Object o1,Object o2) { + Object v1 = map.get(o1); + Object v2 = map.get(o2); + + if(v1.equals(v2)) { + return ((Comparable) o1).compareTo(o2); + } + + return ((Comparable) v2).compareTo(v1); + } + }); + + ans = tmpList.toArray(new String[0]); + + return ans; + } + + public int solution00(int[] user_times, int T) { + int answer = 0 ; + + for (int time : user_times) { + + int multiple = (int) Math.ceil((float)time/T); + int remainTime = multiple * T - time; + answer = Math.max(answer, remainTime); + } + + return answer; + } + + + public String[] solution01(String[] rooms, int target) { + + String[] answer = {}; + + HashMap> roomMap = new HashMap>(); + HashMap> humanMap = new HashMap>(); + + for( String s : rooms) { + + String roomNum = s.substring(s.indexOf("[")+1,s.indexOf("]")); + String[] nameList = s.substring(s.indexOf("]")+1).split(","); + + //System.out.println(roomNum); + //Arrays.stream(nameList).forEach(t -> System.out.println(t)); + + roomMap.put(roomNum, new ArrayList(Arrays.asList(nameList))); + + for(String h : nameList) { + ArrayList list = humanMap.getOrDefault(h, new ArrayList()); + list.add(roomNum); + humanMap.put(h, list); + } + + } + + HashMap> resultMap = new HashMap>(); + + + //켱 + //1. ȣ filtering + int min = 99999; + PriorityQueue pq = new PriorityQueue(new Comparator() { + @Override + public int compare(String o1, String o2) { + int a = Math.abs(target - Integer.parseInt(o1)); + int b = Math.abs(target - Integer.parseInt(o2)); + + return ((Comparable) a).compareTo(b); + } + }); + + for( String s : roomMap.keySet()) { + if(Math.abs(target - Integer.parseInt(s)) != 0) { + pq.add(s); + } + } + + PriorityQueue> pqh = new PriorityQueue>(new Comparator>() { + + @Override + public int compare(HashMap o1, HashMap o2) { + + int size1 = Integer.parseInt(o1.get("size")); + int size2 = Integer.parseInt(o2.get("size")); + String name1 = o1.get("name"); + String name2 = o2.get("name"); + + + if(size1 != size2) { + return ((Comparable) size1).compareTo(size2); + } else { + return ((Comparable) name1).compareTo(name2); + } + + } + + }); + + + for( String s : humanMap.keySet()) { + + if(humanMap.get(s).contains(String.valueOf(target))) { + } else { + HashMap tmp = new HashMap(); + tmp.put("name", s); + tmp.put("size", String.valueOf(humanMap.get(s).size())); + pqh.add(tmp); + } + } + + answer = new String[pqh.size()]; + + int i = 0; + + for (HashMap hashMap : pqh) { + answer[i++] = (hashMap.get("name")); + } + + + Arrays.stream(answer).forEach(t -> System.out.println(t)); + + return answer; + } +} + + diff --git a/src/module-info.java b/src/module-info.java new file mode 100644 index 0000000..62dc43e --- /dev/null +++ b/src/module-info.java @@ -0,0 +1,2 @@ +module codingTest { +} \ No newline at end of file From 6fc47c79e1bac0e9d8f2d4602140d03c0570913f Mon Sep 17 00:00:00 2001 From: seohs Date: Wed, 18 May 2022 00:23:51 +0900 Subject: [PATCH 2/7] add --- bin/codingTest/Animal.class | Bin 489 -> 489 bytes bin/codingTest/Card.class | Bin 356 -> 356 bytes bin/codingTest/Eatable.class | Bin 210 -> 210 bytes bin/codingTest/Person.class | Bin 378 -> 378 bytes bin/codingTest/Solution$1.class | Bin 1389 -> 1389 bytes bin/codingTest/Solution$2.class | Bin 1187 -> 1187 bytes bin/codingTest/Solution$3.class | Bin 1271 -> 1271 bytes bin/codingTest/Solution$4.class | Bin 1741 -> 1741 bytes bin/codingTest/Solution.class | Bin 15797 -> 19225 bytes bin/codingTest/module.class | Bin 6093 -> 6093 bytes bin/module-info.class | Bin 149 -> 149 bytes src/codingTest/module.java | 274 +++++++++++++++++++++++++++----- 12 files changed, 230 insertions(+), 44 deletions(-) diff --git a/bin/codingTest/Animal.class b/bin/codingTest/Animal.class index e39fcc61116a82a78a0d81eb9bba01e997edb641..7c34b71bff18d358734b61645d035cf0634a336e 100644 GIT binary patch delta 17 ZcmaFK{F0gD)W2Q(7#J9AH*!2=1OP@C2KfL0 delta 17 ZcmaFK{F0gD)W2Q(7#J9=H*!2=1OP@22KN8} diff --git a/bin/codingTest/Card.class b/bin/codingTest/Card.class index 6d014711faed61ff5e1050b7efc92912dcc6c7f3..f32a1e958833f15896d44153979a3bc8133d2697 100644 GIT binary patch delta 35 rcmaFD^n{7y)W2Q(7#J9AH*#n)@=7qUFi0|RGDtB9GDuIhV^jkGy&ng@ delta 35 rcmaFD^n{7y)W2Q(7#J9=H*#n)@`^IBFo-d5GKez>GDu9eV^jkGyln@t diff --git a/bin/codingTest/Eatable.class b/bin/codingTest/Eatable.class index 55b3850b3845db5d4124136d33356496ea9f6c64..07b5ee60f286dce5a83c4b25a9fc488cfb6eda02 100644 GIT binary patch delta 16 Ycmcb_c!`nY)W2Q(7#J9ACvuzu06V<~j{pDw delta 16 Ycmcb_c!`nY)W2Q(7#J9=Cvuzu06Vn?jQ{`u diff --git a/bin/codingTest/Person.class b/bin/codingTest/Person.class index ab2460a1cbb1cf01c376e50d811b97042e32cbda..e469ce485e4b1e7c3bcd23bbfd683c6ec8e8705c 100644 GIT binary patch delta 17 Zcmeyx^oxn()W2Q(7#J9AH*yp)0su!l2C4u6 delta 17 Zcmeyx^oxn()W2Q(7#J9=H*yp)0su!b2B-i4 diff --git a/bin/codingTest/Solution$1.class b/bin/codingTest/Solution$1.class index 513a042f9811fa45457141a10a5ad4e5e7f22578..a0c1f9c0d0b031d0a7d7af7ceefcd0e455b723f4 100644 GIT binary patch delta 33 pcmaFM^_Gj{)W2Q(7#J9AH*(mqFm_FLXX#<>W6)*lpL~O5Dgf2U3%LLQ delta 33 pcmaFM^_Gj{)W2Q(7#J9=H*(mqFt$&2XX#<>X3%BonS6s~Dgf0-3$6eF diff --git a/bin/codingTest/Solution$2.class b/bin/codingTest/Solution$2.class index 82701e3859d2f5917dc317fd1464932d327bf295..750138d5fe3bce85e44a735b88348040dbfffca5 100644 GIT binary patch delta 45 zcmV+|0Mh@X38M)J%Ko~(0000zu?V080o{|S18Nc900{!%022b@02~7204D8}`VK8JiXE0~BU~pr$ JntX-zCjfs144MD{ delta 53 zcmX@hdzP2u)W2Q(7#J9=H*zSmGU`v(VeOYRVc=ypWsqhzV^Cu@XE0>8VlZd6W^iM+ JoqUD$Cjfwf46pzI diff --git a/bin/codingTest/Solution.class b/bin/codingTest/Solution.class index 0666773760546388e39c846ba7a0711e3f55c314..7d7d0c76677fe7707693408ffd13fc215e9f60d9 100644 GIT binary patch delta 5011 zcmai234D}QlK)q|ua9&(Aq1Mx=^P*sLQJ>`5W*F12tjU;LqZZc3`tDFfaB4F0a@spTCFSzu zxtLsZZb;negoMj;B$_?Gi;0OoG-#?H|EwWFc6Q{GK<~LWE8VXdcvlc#UtL_iuA+8a zXyB1`5u1l8Izw|Q*%lF4B`Y@w_Fg6yptFVd$f-r zb9L#DO8ZroR;}n)vUbh#irR_QwQEZ2C#)~4sHtC7T}6$G^@8rj|Bu`Vfv>K*a;>e? ze~?G}3OYI}Kq1s;RD{ zq}1?pGnsX3nS}hSgo|mc@Tzwz7j91sbRI<$J^zlM6221ZU^<<>Xwj5D^vlaVU?MBI zVnS(oc}4l0%kSRG(z^QMRaKnwW>1;oD3}qAr#y_LW^H+SWkubkNXFLIUY*M!l*o=M zFp!G!6*Liam94BOyGbzgD&L$KBJwH~6UQHw}6w0ZKiLUeO zLPzvR6czZVR8>5*fh9O)Q2A9}J^ z2wq7;f@GkJWFjctktWw5kK-iig=+HGNp|zGv?7_C2P6I9m;UG=1JOeUQ)~zdBp+jC zD8|b$stm_0DL}c5zzQiujf})?G74cCjXPxww#r!Sk|H!v{~?)-M`ddB%#7=0KnV}_ zb#Ti}WXNpvlDRZJ4})YrM#}M=*wVu7s34RQ<0D7Qv#Z!YNmku15B@o!}Oo6u16!VW!-VrLqO3@&H%gidxx@J0yaiQ~n9rjo-)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>_;kotac}uIaU2L3OT2Q3re+jab+}GFSBp->J|%k#B;9^A2g(&A|9#YN!_1m z;6>9t(ye@mH={dtKl7bnKJ+s{6kk~R*3Tc3_`@NPq3%uzCRcgBgc}`k!{RYaHn*%A HZMO1%ua;o` delta 362 zcmWNN$t%PG6vsc$)*ww`OqMVQqA*b|q>zgP2W85ET*gI>LM~$&Yf*Ce9h5D*C}qOM zVg3LaoXDDe83&?>Y_C_}-s}5b@AIDD?zfw^f46)mx~aZ2&Y-?7Ob>tgIn!RD(S{S4>k1Sqz@PU8UqZgj;c;G!ZHTCjB&^~ z=S*QQ>=Q~jrJOS=G K%c|kFR{aA+GGYe+ diff --git a/bin/module-info.class b/bin/module-info.class index 845d9c6614d1e9614c4e81f6c28920d1dd93cd5c..9fa0d8a184f57812a1a1ef285c5fe7f823a764dd 100644 GIT binary patch delta 16 YcmbQrIF*s()W2Q(7#J9ACvx-x05n true); //Stream filter - //Stream filter ó list ȯ + //Stream filter ó�� �� list ��ȯ //ArrayList alreadyRankUser = (ArrayList) rankList.stream().filter(t -> t[0].equals(userName) && Integer.parseInt(t[1]) >= userScore).collect(Collectors.toList()); //=========================================================== @@ -137,7 +140,7 @@ public static void arrayCollector() { //=========================================================== - //map + //map ���� HashMap map = new HashMap(); HashMap> ma2 = new HashMap>(); @@ -152,27 +155,27 @@ public static void arrayCollector() { //Stack Stack stack = new Stack(); - stack.add(null); //ֱ - stack.empty(); // Ȯ - stack.peek(); //stack ֻ - stack.pop(); //stack + stack.add(null); //�ֱ� + stack.empty(); //������� Ȯ�� + stack.peek(); //stack �ֻ�� �� + stack.pop(); //stack ���� //Queue Queue queue = new LinkedList<>(); - queue.add(null); //ֱ - queue.isEmpty(); // Ȯ - queue.peek(); //queue - queue.poll(); //queue + queue.add(null); //�ֱ� + queue.isEmpty(); //������� Ȯ�� + queue.peek(); //queue ���� �� + queue.poll(); //queue ���� - //Ÿ - //int[] integer[] ٲٴ + //��Ÿ + //int[] �� integer[]�� �ٲٴ� ��� Integer[] arr2 = Arrays.stream( arr ).boxed().toArray( Integer[]::new ); - //forEach + //forEach ���� Arrays.stream(arr).forEach(s -> System.out.println(s)); - //ѱھ split -- Ķ "" + //�ѱ��ھ� split -- �Ķ���� ""�� String str = "12345"; String[] result = str.split(""); @@ -180,14 +183,14 @@ public static void arrayCollector() { Arrays.binarySearch(result, "1"); PriorityQueue q = new PriorityQueue(); - // + //���� /* String[] result = new String[numbers.length]; for (int i = 0; i < numbers.length; i++) { result[i] = String.valueOf(numbers[i]); } - // + // ���� Arrays.sort(result, new Comparator() { @Override @@ -244,15 +247,15 @@ public boolean BinarySearch(int []arr, int len, int key){ int mid; while(end - start >= 0) { - mid = (start + end) / 2; //߾ + mid = (start + end) / 2; //�߾� �� - if (arr[mid] == key) { //key ã + if (arr[mid] == key) { //key���� ã������ return true; - } else if (arr[mid] > key) { //key mid () + } else if (arr[mid] > key) { //key���� mid�� ������ ������ (��������) end = mid - 1; - } else { //key mid Ŭ () + } else { //key���� mid�� ������ Ŭ�� (����������) start = mid + 1; } @@ -272,7 +275,7 @@ class Solution { /** * * @author hs - * @ - ֽ ...... 𸣰ٴ + * @���� - �ֽ� ����...... �� �� �𸣰ٴ� * */ public int[] solution1(int[] prices) { @@ -388,16 +391,16 @@ public String[] solution5(String[] record) { String[] messageContent = str.split(" "); String postFix = ""; if(messageContent[0].equals("Leave")){ - postFix = "ϴ."; + postFix = "�������ϴ�."; } else if(messageContent[0].equals("Change")) { uidMap.replace(messageContent[1], messageContent[2]); } else { - postFix = "Խϴ."; + postFix = "���Խ��ϴ�."; uidMap.put(messageContent[1], messageContent[2]); } if(!messageContent[0].equals("Change")) { - answerStream += messageContent[1]+" "+ postFix + ", "; + answerStream += messageContent[1]+"���� "+ postFix + ", "; } } @@ -553,19 +556,19 @@ public int solution99(int k, String[] user_scores) { rankList.add(new String[] {" ","0"}); } - //K 1̻ 100 ڿ - //user_scores ̴ 1 ̻ 1000 - //user_scores -> г - //ٲ -> г + //K�� 1�̻� 100������ �ڿ��� + //user_scores�� ���̴� 1 �̻� 1000 ���� + //user_scores -> �г��� ���� + //�ٲ�� -> �г��� int z = 0; for(String s : user_scores) { - //ũ + //��ũ ���� ���� �� ������ for(int i = 0; i < k; i++) { String[] rankUser = rankList.get(i); snapShot[i] = rankUser[0].toString(); } - //о ĵ + //�о���� ���� ���� ��ĵ String[] user = s.split(" "); String userName = user[0]; int userScore = Integer.parseInt(user[1]); @@ -579,7 +582,7 @@ public int solution99(int k, String[] user_scores) { if(rankUserScore < userScore) { - //ũ ̹ ִ -> ũ ش. + //��ũ�� �̹� �ִ� ��� -> �� ��ũ�� �����ش�. boolean needRemove = false; int removeIndex = -1; for(int j = 0; j < k; j++) { @@ -613,7 +616,7 @@ public int solution99(int k, String[] user_scores) { } - //ũ + //��ũ ���� ���� �� ������ for(int i = 0; i < k; i++) { String[] rankUser = rankList.get(i); if(!snapShot[i].equals(rankUser[0].toString())) { @@ -634,16 +637,16 @@ public int solution99(int k, String[] user_scores) { return answer; } - // + //���� public String solution13(int[] numbers) { - // ڸ ڿ ȯ + // ���ڸ� ���ڿ��� ��ȯ String[] result = new String[numbers.length]; for (int i = 0; i < numbers.length; i++) { result[i] = String.valueOf(numbers[i]); } - // + // ���� Arrays.sort(result, new Comparator() { @Override @@ -653,13 +656,13 @@ public int compare(String o1, String o2) { } }); - // 0 ִ 迭 ϳ 0 + // 0�� ������ �ִ� �迭�� ��� �ϳ��� 0�� ���� if(result[0].equals("0")) { return "0"; } String answer = ""; - // ĵ ϳ ġ + // ���ĵ� ���� �ϳ��� ��ġ�� for (String a : result) { answer += a; } @@ -669,7 +672,7 @@ public int compare(String o1, String o2) { public int solution14(int[] people, int limit) { - //Ʈ յڷ ¿ ----- Ž + //����Ʈ �յڷ� �¿�� ----- Ž��� int answer = 0; Arrays.sort(people); @@ -787,8 +790,8 @@ public String[] solution01(String[] rooms, int target) { HashMap> resultMap = new HashMap>(); - //켱 - //1. ȣ filtering + //�켱 ���� ��� + //1. ȣ�� filtering int min = 99999; PriorityQueue pq = new PriorityQueue(new Comparator() { @Override @@ -852,6 +855,189 @@ public int compare(HashMap o1, HashMap o2) { return answer; } + + static String solution(String s) { + String answer = ""; + + String[] list = s.split(" ",0); + + for(int i = 0; i < list.length; i++) { + list[i] = list[i].toLowerCase(); + if(isStringInt(list[i].substring(0,1))) { + //do Nothing + } else { + list[i] = list[i].substring(0,1).toUpperCase() + list[i].substring(1); + } + } + StringBuilder sb = new StringBuilder(); + + for(int i = 0; i < list.length; i++) { + if(i != 0) { + sb.append(" "+list[i]); + } else { + sb.append(list[i]); + } + } + + + return answer; + } + + static boolean isStringInt(String a) { + try { + Integer.parseInt(a); + return true; + } catch (NumberFormatException ex) { + return false; + } + } + + static int solution03(int N, int number) { + + int answer = 0; + + List> listSet = new ArrayList>(); + + for (int i = 0; i < 9; i++) { + listSet.add(new HashSet()); + } + + listSet.get(1).add(N); + + + for (int i = 2; i < 9; i++) { + Set countSet = new HashSet(); + + for(int j = 1; j < 9; j++) { + Set pre = listSet.get(j); + Set post = listSet.get(i-j); + + for(Integer p : pre) { + for(Integer q : post) { + countSet.add(p+q); + countSet.add(p-q); + countSet.add(p*q); + if(p != 0 && q != 0) { + countSet.add(p/q); + } + } + } + } + countSet.add(Integer.parseInt(String.valueOf(N).repeat(i))); + } + + for(Set sub : listSet){ + if(sub.contains(number)) + return listSet.indexOf(sub); + } + + return answer; + } + + //@Link : https://programmers.co.kr/learn/courses/30/lessons/43105 + static int solution04(int[][] triangle) { + int answer = 0; + + int[][] addedTriangle = new int[triangle.length][triangle.length]; + + addedTriangle[0][0] = triangle[0][0]; + + for(int i = 1 ; i < triangle.length; i++) { + for(int j = 0; j < triangle[i].length; j++) { + + if(j == 0) { + addedTriangle[i][j] = triangle[i][j] + addedTriangle[i-1][0]; + } else if (j == triangle[i].length -1 ) { + addedTriangle[i][j] = triangle[i][j] + addedTriangle[i-1][j-1]; + } else { + addedTriangle[i][j] = triangle[i][j] + Math.max(addedTriangle[i-1][j-1], addedTriangle[i-1][j]); + } + } + } + + int tmp = -1; + int lastLine = triangle.length-1; + for(int i = 0 ; i < triangle[lastLine].length; i++) { + if (tmp < addedTriangle[lastLine][i]) { + tmp = addedTriangle[lastLine][i]; + } + } + + answer = tmp; + + return answer; + } + + //@Link : https://programmers.co.kr/learn/courses/30/lessons/42898 + public int solution04(int m, int n, int[][] puddles) { + int answer = 0; + + int[][] countArr = new int[n][m]; + + countArr[0][0] = 0; + + for(int[] list : puddles){ + countArr[list[1]-1][list[0]-1] = -1; + } + + for(int i = 0; i < n ; i++){ + for(int j = 0; j < m ; j++){ + if(countArr[i][j] == -1) { + countArr[i][j] = 0; + continue; + } else { + if( (i == 0 && j == 1) || (i == 1 && j == 0)) { + countArr[i][j] = 1; + continue; + } + + if( i == 0 && j > 1) { + countArr[i][j] = countArr[i][j-1]; + continue; + } + if( j == 0 && i > 1) { + countArr[i][j] = countArr[i-1][j]; + continue; + } + if( j >= 1 && i >= 1) { + // System.out.println("i : " + i + " j : " + j); + // System.out.println(countArr[i-1][j] + " / " + countArr[i][j-1]); + countArr[i][j] = (countArr[i-1][j] + countArr[i][j-1]) % 1000000007; + } + } + } + } + + // for(int i = 0; i < n; i++) { + // for(int j = 0; j < m; j++) { + // System.out.print(countArr[i][j] + " "); + // } + // System.out.println(); + // } + + return countArr[n-1][m-1] % 1000000007; + } + + //@Link : https://programmers.co.kr/learn/courses/30/lessons/49189 + public int solution05(int n, int[][] edge) { + + int answer = 0; + int check[] = new int[n]; + + List> list = new ArrayList<>(); + + list.add(new ArrayList()); + + for(int[] i : edge) { + list.get(i[0]).add(i[1]); + } + + Queue q = new LinkedList<>(); + + + + return answer; + } } From 2f2918cfb2ccf8461acb8a90ff12537060bc0c54 Mon Sep 17 00:00:00 2001 From: seohs Date: Wed, 18 May 2022 22:00:59 +0900 Subject: [PATCH 3/7] dd --- src/codingTest/module.java | 114 +++++++++++++++++++++++-------------- 1 file changed, 70 insertions(+), 44 deletions(-) diff --git a/src/codingTest/module.java b/src/codingTest/module.java index 3810a87..1df5380 100644 --- a/src/codingTest/module.java +++ b/src/codingTest/module.java @@ -30,7 +30,7 @@ class Card{ public class module { public static void main(String[] args) { - //����Ǯ�� �⺻ ��� + //占쏙옙占쏙옙풀占쏙옙 占썩본 占쏙옙占� Solution s = new Solution(); String[] answer = {}; @@ -110,14 +110,14 @@ public static void arrayCollector() { //array - int[] arr = new int [1]; //length�� ���� �־��� �Ѵ�. - String[] n = new String [1]; //�������� + int[] arr = new int [1]; //length占쏙옙 占쏙옙占쏙옙 占쌍억옙占쏙옙 占싼댐옙. + String[] n = new String [1]; //占쏙옙占쏙옙占쏙옙占쏙옙 - Arrays.sort(arr); //Array ���� (��������) + Arrays.sort(arr); //Array 占쏙옙占쏙옙 (占쏙옙占쏙옙占쏙옙占쏙옙) Arrays.stream(arr).sum(); //Array sum (int) Arrays.stream(n).filter(s -> true); //Stream filter - //Stream filter ó�� �� list ��ȯ + //Stream filter 처占쏙옙 占쏙옙 list 占쏙옙환 //ArrayList alreadyRankUser = (ArrayList) rankList.stream().filter(t -> t[0].equals(userName) && Integer.parseInt(t[1]) >= userScore).collect(Collectors.toList()); //=========================================================== @@ -140,7 +140,7 @@ public static void arrayCollector() { //=========================================================== - //map ���� + //map 占쏙옙占쏙옙 HashMap map = new HashMap(); HashMap> ma2 = new HashMap>(); @@ -155,27 +155,27 @@ public static void arrayCollector() { //Stack Stack stack = new Stack(); - stack.add(null); //�ֱ� - stack.empty(); //������� Ȯ�� - stack.peek(); //stack �ֻ�� �� - stack.pop(); //stack ���� + stack.add(null); //占쌍깍옙 + stack.empty(); //占쏙옙占쏙옙占쏙옙占� 확占쏙옙 + stack.peek(); //stack 占쌍삼옙占� 占쏙옙 + stack.pop(); //stack 占쏙옙占쏙옙 //Queue Queue queue = new LinkedList<>(); - queue.add(null); //�ֱ� - queue.isEmpty(); //������� Ȯ�� - queue.peek(); //queue ���� �� - queue.poll(); //queue ���� + queue.add(null); //占쌍깍옙 + queue.isEmpty(); //占쏙옙占쏙옙占쏙옙占� 확占쏙옙 + queue.peek(); //queue 占쏙옙占쏙옙 占쏙옙 + queue.poll(); //queue 占쏙옙占쏙옙 - //��Ÿ - //int[] �� integer[]�� �ٲٴ� ��� + //占쏙옙타 + //int[] 占쏙옙 integer[]占쏙옙 占쌕꾸댐옙 占쏙옙占� Integer[] arr2 = Arrays.stream( arr ).boxed().toArray( Integer[]::new ); - //forEach ���� + //forEach 占쏙옙占쏙옙 Arrays.stream(arr).forEach(s -> System.out.println(s)); - //�ѱ��ھ� split -- �Ķ���� ""�� + //占싼깍옙占쌘억옙 split -- 占식띰옙占쏙옙占� ""占쏙옙 String str = "12345"; String[] result = str.split(""); @@ -183,14 +183,14 @@ public static void arrayCollector() { Arrays.binarySearch(result, "1"); PriorityQueue q = new PriorityQueue(); - //���� + //占쏙옙占쏙옙 /* String[] result = new String[numbers.length]; for (int i = 0; i < numbers.length; i++) { result[i] = String.valueOf(numbers[i]); } - // ���� + // 占쏙옙占쏙옙 Arrays.sort(result, new Comparator() { @Override @@ -247,15 +247,15 @@ public boolean BinarySearch(int []arr, int len, int key){ int mid; while(end - start >= 0) { - mid = (start + end) / 2; //�߾� �� + mid = (start + end) / 2; //占쌩억옙 占쏙옙 - if (arr[mid] == key) { //key���� ã������ + if (arr[mid] == key) { //key占쏙옙占쏙옙 찾占쏙옙占쏙옙占쏙옙 return true; - } else if (arr[mid] > key) { //key���� mid�� ������ ������ (��������) + } else if (arr[mid] > key) { //key占쏙옙占쏙옙 mid占쏙옙 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 (占쏙옙占쏙옙占쏙옙占쏙옙) end = mid - 1; - } else { //key���� mid�� ������ Ŭ�� (����������) + } else { //key占쏙옙占쏙옙 mid占쏙옙 占쏙옙占쏙옙占쏙옙 클占쏙옙 (占쏙옙占쏙옙占쏙옙占쏙옙占쏙옙) start = mid + 1; } @@ -275,7 +275,7 @@ class Solution { /** * * @author hs - * @���� - �ֽ� ����...... �� �� �𸣰ٴ� + * @占쏙옙占쏙옙 - 占쌍쏙옙 占쏙옙占쏙옙...... 占쏙옙 占쏙옙 占쏜르겟댐옙 * */ public int[] solution1(int[] prices) { @@ -391,16 +391,16 @@ public String[] solution5(String[] record) { String[] messageContent = str.split(" "); String postFix = ""; if(messageContent[0].equals("Leave")){ - postFix = "�������ϴ�."; + postFix = "占쏙옙占쏙옙占쏙옙占싹댐옙."; } else if(messageContent[0].equals("Change")) { uidMap.replace(messageContent[1], messageContent[2]); } else { - postFix = "���Խ��ϴ�."; + postFix = "占쏙옙占쌉쏙옙占싹댐옙."; uidMap.put(messageContent[1], messageContent[2]); } if(!messageContent[0].equals("Change")) { - answerStream += messageContent[1]+"���� "+ postFix + ", "; + answerStream += messageContent[1]+"占쏙옙占쏙옙 "+ postFix + ", "; } } @@ -556,19 +556,19 @@ public int solution99(int k, String[] user_scores) { rankList.add(new String[] {" ","0"}); } - //K�� 1�̻� 100������ �ڿ��� - //user_scores�� ���̴� 1 �̻� 1000 ���� - //user_scores -> �г��� ���� - //�ٲ�� -> �г��� + //K占쏙옙 1占싱삼옙 100占쏙옙占쏙옙占쏙옙 占쌘울옙占쏙옙 + //user_scores占쏙옙 占쏙옙占싱댐옙 1 占싱삼옙 1000 占쏙옙占쏙옙 + //user_scores -> 占싻놂옙占쏙옙 占쏙옙占쏙옙 + //占쌕뀐옙占� -> 占싻놂옙占쏙옙 int z = 0; for(String s : user_scores) { - //��ũ ���� ���� �� ������ + //占쏙옙크 占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙 占쏙옙占쏙옙占쏙옙 for(int i = 0; i < k; i++) { String[] rankUser = rankList.get(i); snapShot[i] = rankUser[0].toString(); } - //�о���� ���� ���� ��ĵ + //占싻억옙占쏙옙占� 占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙캔 String[] user = s.split(" "); String userName = user[0]; int userScore = Integer.parseInt(user[1]); @@ -582,7 +582,7 @@ public int solution99(int k, String[] user_scores) { if(rankUserScore < userScore) { - //��ũ�� �̹� �ִ� ��� -> �� ��ũ�� �����ش�. + //占쏙옙크占쏙옙 占싱뱄옙 占쌍댐옙 占쏙옙占� -> 占쏙옙 占쏙옙크占쏙옙 占쏙옙占쏙옙占쌔댐옙. boolean needRemove = false; int removeIndex = -1; for(int j = 0; j < k; j++) { @@ -616,7 +616,7 @@ public int solution99(int k, String[] user_scores) { } - //��ũ ���� ���� �� ������ + //占쏙옙크 占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙 占쏙옙占쏙옙占쏙옙 for(int i = 0; i < k; i++) { String[] rankUser = rankList.get(i); if(!snapShot[i].equals(rankUser[0].toString())) { @@ -637,16 +637,16 @@ public int solution99(int k, String[] user_scores) { return answer; } - //���� + //占쏙옙占쏙옙 public String solution13(int[] numbers) { - // ���ڸ� ���ڿ��� ��ȯ + // 占쏙옙占쌘몌옙 占쏙옙占쌘울옙占쏙옙 占쏙옙환 String[] result = new String[numbers.length]; for (int i = 0; i < numbers.length; i++) { result[i] = String.valueOf(numbers[i]); } - // ���� + // 占쏙옙占쏙옙 Arrays.sort(result, new Comparator() { @Override @@ -656,13 +656,13 @@ public int compare(String o1, String o2) { } }); - // 0�� ������ �ִ� �迭�� ��� �ϳ��� 0�� ���� + // 0占쏙옙 占쏙옙占쏙옙占쏙옙 占쌍댐옙 占썼열占쏙옙 占쏙옙占� 占싹놂옙占쏙옙 0占쏙옙 占쏙옙占쏙옙 if(result[0].equals("0")) { return "0"; } String answer = ""; - // ���ĵ� ���� �ϳ��� ��ġ�� + // 占쏙옙占식듸옙 占쏙옙占쏙옙 占싹놂옙占쏙옙 占쏙옙치占쏙옙 for (String a : result) { answer += a; } @@ -672,7 +672,7 @@ public int compare(String o1, String o2) { public int solution14(int[] people, int limit) { - //����Ʈ �յڷ� �¿�� ----- Ž��� + //占쏙옙占쏙옙트 占쌌뒤뤄옙 占승울옙占� ----- 탐占쏙옙占� int answer = 0; Arrays.sort(people); @@ -790,8 +790,8 @@ public String[] solution01(String[] rooms, int target) { HashMap> resultMap = new HashMap>(); - //�켱 ���� ��� - //1. ȣ�� filtering + //占쎌선 占쏙옙占쏙옙 占쏙옙占� + //1. 호占쏙옙 filtering int min = 99999; PriorityQueue pq = new PriorityQueue(new Comparator() { @Override @@ -1036,6 +1036,32 @@ public int solution05(int n, int[][] edge) { + return answer; + } + + //@Link : https://programmers.co.kr/learn/courses/30/lessons/43238 + public long solution(int n, int[] times) { + + long answer = 0; + + Arrays.sort(times); + + int[] copyTimes = new int[times.length]; + + copyTimes = Arrays.copyOf(times, times.length); + + + int[] manTimes = new int[n]; + + for(int i = 0; i < n; i++) { + + + manTimes[i] = Arrays. + } + + + + return answer; } } From 3e9af5e96db80777e82564e45918aad7b99505e6 Mon Sep 17 00:00:00 2001 From: seohs Date: Thu, 19 May 2022 21:05:46 +0900 Subject: [PATCH 4/7] add --- src/codingTest/module.java | 192 +++++++++++++++++++++++++------------ 1 file changed, 129 insertions(+), 63 deletions(-) diff --git a/src/codingTest/module.java b/src/codingTest/module.java index 1df5380..7524d5b 100644 --- a/src/codingTest/module.java +++ b/src/codingTest/module.java @@ -1,5 +1,6 @@ package codingTest; +import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -30,7 +31,8 @@ class Card{ public class module { public static void main(String[] args) { - //占쏙옙占쏙옙풀占쏙옙 占썩본 占쏙옙占� + + //문제풀이 기본 양식 Solution s = new Solution(); String[] answer = {}; @@ -110,14 +112,14 @@ public static void arrayCollector() { //array - int[] arr = new int [1]; //length占쏙옙 占쏙옙占쏙옙 占쌍억옙占쏙옙 占싼댐옙. - String[] n = new String [1]; //占쏙옙占쏙옙占쏙옙占쏙옙 + int[] arr = new int [1]; //length를 필히 넣어햐 한다. + String[] n = new String [1]; //마찬가지 - Arrays.sort(arr); //Array 占쏙옙占쏙옙 (占쏙옙占쏙옙占쏙옙占쏙옙) + Arrays.sort(arr); //Array 정렬 (오름차순) Arrays.stream(arr).sum(); //Array sum (int) Arrays.stream(n).filter(s -> true); //Stream filter - //Stream filter 처占쏙옙 占쏙옙 list 占쏙옙환 + //Stream filter 처리 후 list 변환 //ArrayList alreadyRankUser = (ArrayList) rankList.stream().filter(t -> t[0].equals(userName) && Integer.parseInt(t[1]) >= userScore).collect(Collectors.toList()); //=========================================================== @@ -140,7 +142,7 @@ public static void arrayCollector() { //=========================================================== - //map 占쏙옙占쏙옙 + //map 선언 HashMap map = new HashMap(); HashMap> ma2 = new HashMap>(); @@ -155,27 +157,27 @@ public static void arrayCollector() { //Stack Stack stack = new Stack(); - stack.add(null); //占쌍깍옙 - stack.empty(); //占쏙옙占쏙옙占쏙옙占� 확占쏙옙 - stack.peek(); //stack 占쌍삼옙占� 占쏙옙 - stack.pop(); //stack 占쏙옙占쏙옙 + stack.add(null); //넣기 + stack.empty(); //비었는지 확인 + stack.peek(); //stack 최상단 값 + stack.pop(); //stack 빼기 //Queue Queue queue = new LinkedList<>(); - queue.add(null); //占쌍깍옙 - queue.isEmpty(); //占쏙옙占쏙옙占쏙옙占� 확占쏙옙 - queue.peek(); //queue 占쏙옙占쏙옙 占쏙옙 - queue.poll(); //queue 占쏙옙占쏙옙 + queue.add(null); //넣기 + queue.isEmpty(); //비었는지 확인 + queue.peek(); //queue 나올 값 + queue.poll(); //queue 빼기 - //占쏙옙타 - //int[] 占쏙옙 integer[]占쏙옙 占쌕꾸댐옙 占쏙옙占� + //기타 + //int[] 를 integer[]로 바꾸는 방법 Integer[] arr2 = Arrays.stream( arr ).boxed().toArray( Integer[]::new ); - //forEach 占쏙옙占쏙옙 + //forEach 구문 Arrays.stream(arr).forEach(s -> System.out.println(s)); - //占싼깍옙占쌘억옙 split -- 占식띰옙占쏙옙占� ""占쏙옙 + //한글자씩 split -- 파라미터 ""로 String str = "12345"; String[] result = str.split(""); @@ -183,19 +185,16 @@ public static void arrayCollector() { Arrays.binarySearch(result, "1"); PriorityQueue q = new PriorityQueue(); - //占쏙옙占쏙옙 + //정렬 /* String[] result = new String[numbers.length]; for (int i = 0; i < numbers.length; i++) { result[i] = String.valueOf(numbers[i]); } - - // 占쏙옙占쏙옙 + // 정렬 Arrays.sort(result, new Comparator() { - @Override public int compare(String o1, String o2) { - return ((o2 + o1).compareTo(o1 + o2)); } }); @@ -247,15 +246,15 @@ public boolean BinarySearch(int []arr, int len, int key){ int mid; while(end - start >= 0) { - mid = (start + end) / 2; //占쌩억옙 占쏙옙 + mid = (start + end) / 2; //중앙 값 - if (arr[mid] == key) { //key占쏙옙占쏙옙 찾占쏙옙占쏙옙占쏙옙 + if (arr[mid] == key) { //key값을 찾았을때 return true; - } else if (arr[mid] > key) { //key占쏙옙占쏙옙 mid占쏙옙 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 (占쏙옙占쏙옙占쏙옙占쏙옙) + } else if (arr[mid] > key) { //key값이 mid의 값보다 작을때 (왼쪽으로) end = mid - 1; - } else { //key占쏙옙占쏙옙 mid占쏙옙 占쏙옙占쏙옙占쏙옙 클占쏙옙 (占쏙옙占쏙옙占쏙옙占쏙옙占쏙옙) + } else { //key값이 mid의 값보다 클때 (오른쪽으로) start = mid + 1; } @@ -275,7 +274,7 @@ class Solution { /** * * @author hs - * @占쏙옙占쏙옙 - 占쌍쏙옙 占쏙옙占쏙옙...... 占쏙옙 占쏙옙 占쏜르겟댐옙 + * @스택 - 주식 가격...... 얘 잘 모르겟다 * */ public int[] solution1(int[] prices) { @@ -391,16 +390,16 @@ public String[] solution5(String[] record) { String[] messageContent = str.split(" "); String postFix = ""; if(messageContent[0].equals("Leave")){ - postFix = "占쏙옙占쏙옙占쏙옙占싹댐옙."; + postFix = "나갔습니다."; } else if(messageContent[0].equals("Change")) { uidMap.replace(messageContent[1], messageContent[2]); } else { - postFix = "占쏙옙占쌉쏙옙占싹댐옙."; + postFix = "들어왔습니다."; uidMap.put(messageContent[1], messageContent[2]); } if(!messageContent[0].equals("Change")) { - answerStream += messageContent[1]+"占쏙옙占쏙옙 "+ postFix + ", "; + answerStream += messageContent[1]+"님이 "+ postFix + ", "; } } @@ -556,19 +555,19 @@ public int solution99(int k, String[] user_scores) { rankList.add(new String[] {" ","0"}); } - //K占쏙옙 1占싱삼옙 100占쏙옙占쏙옙占쏙옙 占쌘울옙占쏙옙 - //user_scores占쏙옙 占쏙옙占싱댐옙 1 占싱삼옙 1000 占쏙옙占쏙옙 - //user_scores -> 占싻놂옙占쏙옙 占쏙옙占쏙옙 - //占쌕뀐옙占� -> 占싻놂옙占쏙옙 + //K는 1이상 100이하인 자연수 + //user_scores의 길이는 1 이상 1000 이하 + //user_scores -> 닉네임 점수 + //바뀐다 -> 닉네임 int z = 0; for(String s : user_scores) { - //占쏙옙크 占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙 占쏙옙占쏙옙占쏙옙 + //랭크 정보 변경 전 스냅샷 for(int i = 0; i < k; i++) { String[] rankUser = rankList.get(i); snapShot[i] = rankUser[0].toString(); } - //占싻억옙占쏙옙占� 占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙캔 + //읽어들인 유저 정보 스캔 String[] user = s.split(" "); String userName = user[0]; int userScore = Integer.parseInt(user[1]); @@ -582,7 +581,7 @@ public int solution99(int k, String[] user_scores) { if(rankUserScore < userScore) { - //占쏙옙크占쏙옙 占싱뱄옙 占쌍댐옙 占쏙옙占� -> 占쏙옙 占쏙옙크占쏙옙 占쏙옙占쏙옙占쌔댐옙. + //랭크에 이미 있는 경우 -> 구 랭크를 지워준다. boolean needRemove = false; int removeIndex = -1; for(int j = 0; j < k; j++) { @@ -616,7 +615,7 @@ public int solution99(int k, String[] user_scores) { } - //占쏙옙크 占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙 占쏙옙占쏙옙占쏙옙 + //랭크 정보 변경 전 스냅샷 for(int i = 0; i < k; i++) { String[] rankUser = rankList.get(i); if(!snapShot[i].equals(rankUser[0].toString())) { @@ -637,16 +636,16 @@ public int solution99(int k, String[] user_scores) { return answer; } - //占쏙옙占쏙옙 + //정렬 public String solution13(int[] numbers) { - // 占쏙옙占쌘몌옙 占쏙옙占쌘울옙占쏙옙 占쏙옙환 + // 숫자를 문자열로 변환 String[] result = new String[numbers.length]; for (int i = 0; i < numbers.length; i++) { result[i] = String.valueOf(numbers[i]); } - // 占쏙옙占쏙옙 + // 정렬 Arrays.sort(result, new Comparator() { @Override @@ -656,13 +655,13 @@ public int compare(String o1, String o2) { } }); - // 0占쏙옙 占쏙옙占쏙옙占쏙옙 占쌍댐옙 占썼열占쏙옙 占쏙옙占� 占싹놂옙占쏙옙 0占쏙옙 占쏙옙占쏙옙 + // 0만 여러개 있는 배열의 경우 하나의 0만 리턴 if(result[0].equals("0")) { return "0"; } String answer = ""; - // 占쏙옙占식듸옙 占쏙옙占쏙옙 占싹놂옙占쏙옙 占쏙옙치占쏙옙 + // 정렬된 문자 하나로 합치기 for (String a : result) { answer += a; } @@ -672,7 +671,7 @@ public int compare(String o1, String o2) { public int solution14(int[] people, int limit) { - //占쏙옙占쏙옙트 占쌌뒤뤄옙 占승울옙占� ----- 탐占쏙옙占� + //구명보트 앞뒤로 태우기 ----- 탐욕법 int answer = 0; Arrays.sort(people); @@ -790,8 +789,8 @@ public String[] solution01(String[] rooms, int target) { HashMap> resultMap = new HashMap>(); - //占쎌선 占쏙옙占쏙옙 占쏙옙占� - //1. 호占쏙옙 filtering + //우선 순위 고려 + //1. 호수 filtering int min = 99999; PriorityQueue pq = new PriorityQueue(new Comparator() { @Override @@ -1040,30 +1039,97 @@ public int solution05(int n, int[][] edge) { } //@Link : https://programmers.co.kr/learn/courses/30/lessons/43238 - public long solution(int n, int[] times) { + public long solution06(int n, int[] times) { - long answer = 0; + long answer = Long.MAX_VALUE; Arrays.sort(times); - int[] copyTimes = new int[times.length]; - - copyTimes = Arrays.copyOf(times, times.length); + long start = times[0]; // 1분 부터 + long end = (long)times[times.length-1]*(long)n; //times에는 심사대 마다 걸리는 시간이 걸려있으니 최대시간 = 가장오래걸리는시간 * 인원수 - - int[] manTimes = new int[n]; - - for(int i = 0; i < n; i++) { - - - manTimes[i] = Arrays. + long mid ; + long sum = 0; + while(start<=end) { + mid= (start+end)/2; + sum = 0; + for(int time : times) { + sum+= mid/time; + } + + if(sum>=n) { + answer = Math.min(answer, mid); + end = mid-1; + } + else { + start = mid+1; + } } - - - - return answer; } + + //@Link : https://programmers.co.kr/learn/courses/30/lessons/42860 + public int solution07(String name) { + int answer = 0; + int length = name.length(); + + int index; // 다음 값들을 확인할 때 사용 + int move = length - 1; // 좌우 움직임 수를 체크 + + for(int i = 0; i < name.length(); i++){ + answer += Math.min(name.charAt(i) - 'A', 'Z' - name.charAt(i) + 1); + + index = i + 1; + // 연속되는 A 갯수 확인 + while(index < length && name.charAt(index) == 'A'){ + index++; + } + + move = Math.min(move, i * 2 + length - index); + + move = Math.min(move, (length - index) * 2 + i); + } + return answer + move; + } + + + //@Link : https://programmers.co.kr/learn/courses/30/lessons/42883 + public String solution08(String number, int k) { + StringBuilder answer = new StringBuilder(""); + int len = number.length() - k; + int start = 0; + + while(start < number.length() && answer.length() != len) { + int leftNum = k + answer.length() + 1; + int max = 0; + for (int j = start; j < leftNum; j++) { + if (max < number.charAt(j) - '0') { + max = number.charAt(j) - '0'; + start = j + 1; + } + } + answer.append(Integer.toString(max)); + } + return answer.toString(); + } + + //@Link : https://programmers.co.kr/learn/courses/30/lessons/42885 + public int solution09(int[] people, int limit) { + List list = new ArrayList<>(); + for(int x : people) list.add(x); + Collections.sort(list); + ArrayDeque dq = new ArrayDeque<>(50505); + for(int x : list) dq.add(x); + + int ans = 0; + while(dq.isEmpty() == false) { + int weight = dq.pollLast(); + if(dq.isEmpty() == false && weight + dq.peekFirst() <= limit) { dq.pollFirst(); } + ans++; + } + + return ans; + } } From ca987409377364f15ab94c77dc42a131b689a4f0 Mon Sep 17 00:00:00 2001 From: Date: Fri, 20 May 2022 00:36:43 +0900 Subject: [PATCH 5/7] add --- src/codingTest/module.java | 172 ++++++++++++++++++++++++++++++++++++- 1 file changed, 171 insertions(+), 1 deletion(-) diff --git a/src/codingTest/module.java b/src/codingTest/module.java index 7524d5b..3b16c90 100644 --- a/src/codingTest/module.java +++ b/src/codingTest/module.java @@ -42,7 +42,9 @@ public static void main(String[] args) { String[] rooms= {"[1234]None,Of,People,Here", "[5678]Wow"}; int target = 1234; - System.out.println(s.solution01(rooms, target)); +// System.out.println(s.solution11(new String[] {"I 16","D 1"})); +// System.out.println(s.solution11(new String[] {"I 16", "I -5643", "D -1", "D 1", "D 1", "I 123", "D -1"})); + System.out.println(s.solution13(12,6)); // answer = s.solution("JEROEN"); // System.out.println(" answer : " + answer); @@ -1130,6 +1132,174 @@ public int solution09(int[] people, int limit) { return ans; } + + //@Link : https://programmers.co.kr/learn/courses/30/lessons/42627 + public int solution10(int[][] jobs) { + int answer = 0; + + Arrays.sort(jobs, (o1, o2) -> o1[0] - o2[0]); + + PriorityQueue pq = new PriorityQueue<>((o1, o2) -> o1[1] - o2[1]); + + int jobsIdx = 0; + int count =0; + int end = 0; + + while(count < jobs.length) { + while(jobsIdx < jobs.length && jobs[jobsIdx][0] <= end) { + System.out.println(jobs[jobsIdx][0] + " " + jobs[jobsIdx][1]); + + pq.add(jobs[jobsIdx++]); + } + + if(pq.isEmpty()) { + end = jobs[jobsIdx][0]; + } else { + int[] temp = pq.poll(); + answer += temp[1] + end - temp[0]; + end += temp[1]; + count++; + } + } + + return (int) Math.floor(answer / jobs.length); + + } + + //@Link : https://programmers.co.kr/learn/courses/30/lessons/42628 + public int[] solution11(String[] operations) { + int[] answer = new int[2]; + + PriorityQueue maxPq = new PriorityQueue<>(Collections.reverseOrder()); + PriorityQueue minPq = new PriorityQueue<>(); + + List addedList = new ArrayList(); + List removedList = new ArrayList(); + + int maxDelCount = 0; + int minDelCount = 0; + + for(String s : operations) { + System.out.println(s); + + String order = s.split(" ")[0]; + int val = Integer.parseInt(s.split(" ")[1]); + + if(order.equals("I")) { + System.out.println("Insert => " + s.split(" ")[1]); + + addedList.add(Integer.parseInt(s.split(" ")[1])); + maxPq.add(val); + minPq.add(val); + + } else if (order.equals("D") && val == 1) { + System.out.println("Delete Max => " + maxPq.peek()); + if(!maxPq.isEmpty()) { + minPq.remove((maxPq.poll())); + + } + + } else if (order.equals("D") && val == -1) { + System.out.println("Delete Min =>" + minPq.peek()); + if(!minPq.isEmpty()) { + maxPq.remove(minPq.poll()); + } + } + } + + + answer[0] = maxPq.isEmpty() ? 0 : maxPq.peek(); + answer[1] = minPq.isEmpty() ? 0 : minPq.peek(); + + return answer; + } + + //@Link : https://programmers.co.kr/learn/courses/30/lessons/42840 + public int [] solution12(int[] answers) { + int[] answer = {}; + + int[] person1 = new int[] {1,2,3,4,5}; + int[] person2 = new int[] {2,1,2,3,2,4,2,5}; + int[] person3 = new int[] {3,3,1,1,2,2,4,4,5,5}; + + int correct1 = 0; + int correct2 = 0; + int correct3 = 0; + + for(int i = 0; i < answers.length; i++) { + if(answers[i] == person1[i % (person1.length)]) { + correct1++; + } + if(answers[i] == person2[i % (person2.length)]) { + correct2++; + } + if(answers[i] == person3[i % (person3.length)]) { + correct3++; + } + } + + int max = Math.max(correct1, correct2); + max = Math.max(max, correct3); + List list = new ArrayList(); + + if(correct1 == max) { + list.add(1); + } + if(correct2 == max) { + list.add(2); + } + if(correct3 == max) { + list.add(3); + } + + list.sort((o1, o2) -> o1.compareTo(o2)); + + answer = list.stream().mapToInt(i->i).toArray(); + + System.out.println(correct1); + System.out.println(correct2); + System.out.println(correct3); + + Arrays.stream(answer).forEach(s->System.out.println(s)); + + return answer; + } + + //@Link : https://programmers.co.kr/learn/courses/30/lessons/42842 + public int[] solution13(int brown, int yellow) { + int[] answer = new int[2]; + + List arr = new ArrayList(); + int n = yellow; + int sqrt = (int) Math.sqrt(n); + + for(int i = 1; i<= sqrt; i++) { + if( n % 1 == 0) { + arr.add(i); + if(n / i != i) { + arr.add(n / i); + } + + } + } + + arr.sort(Comparator.naturalOrder()); + + for(int i : arr) { + int vertical = i; + int horizontal = yellow / i; + + if(yellow%vertical == 0 && brown == ((int)vertical+2) * ((int)horizontal+2) - yellow) { + answer[0] = horizontal+2; + answer[1] = vertical+2; + break; + } + + } + + return answer; + } + } From cf52bbd6db8100d41db841e2ca8af726dd7605d5 Mon Sep 17 00:00:00 2001 From: seohs Date: Sun, 22 May 2022 01:25:23 +0900 Subject: [PATCH 6/7] # WARNING: head commit changed in the meantime add --- src/codingTest/module.java | 144 ++++++++++++++++++------------------- 1 file changed, 72 insertions(+), 72 deletions(-) diff --git a/src/codingTest/module.java b/src/codingTest/module.java index 3b16c90..c3d7948 100644 --- a/src/codingTest/module.java +++ b/src/codingTest/module.java @@ -30,82 +30,82 @@ class Card{ public class module { - public static void main(String[] args) { - - //문제풀이 기본 양식 - Solution s = new Solution(); - String[] answer = {}; - - - //String[] rooms= {"[403]James", "[404]Azad,Louis,Andy", "[101]Azad,Guard"}; - //String[] rooms= {"[101]Azad,Guard", "[202]Guard", "[303]Guard,Dzaz"}; - String[] rooms= {"[1234]None,Of,People,Here", "[5678]Wow"}; - int target = 1234; - -// System.out.println(s.solution11(new String[] {"I 16","D 1"})); -// System.out.println(s.solution11(new String[] {"I 16", "I -5643", "D -1", "D 1", "D 1", "I 123", "D -1"})); - System.out.println(s.solution13(12,6)); - -// answer = s.solution("JEROEN"); -// System.out.println(" answer : " + answer); - - - //answer = s.solution(new String[]{"spy","ray","spy","room","once","ray","spy","once"} ); -// answer = s.solution(new String[]{"spy","ray","spy","room","once","ray","spy","once", "room"} ); -// System.out.println(" answer : " + answer); -// Arrays.stream(answer).forEach(t -> System.out.println(t)); +// public static void main(String[] args) { // -// int ans = 0; -// ans = s.solution00(new int[] {20,40,65,110}, 30); -// System.out.println(ans); - - // - - - - - //dfs, bfs -// Scanner sc = new Scanner(System.in); -// int n = sc.nextInt(); -// int m = sc.nextInt(); -// int start = sc.nextInt(); -// a = (ArrayList[]) new ArrayList[n+1]; -// for (int i=1; i<=n; i++) { -// a[i] = new ArrayList(); -// } -// for (int i=0; i System.out.println(t)); +//// +//// int ans = 0; +//// ans = s.solution00(new int[] {20,40,65,110}, 30); +//// System.out.println(ans); +// +// // +// +// +// +// +// //dfs, bfs +//// Scanner sc = new Scanner(System.in); +//// int n = sc.nextInt(); +//// int m = sc.nextInt(); +//// int start = sc.nextInt(); +//// a = (ArrayList[]) new ArrayList[n+1]; +//// for (int i=1; i<=n; i++) { +//// a[i] = new ArrayList(); +//// } +//// for (int i=0; i Date: Sun, 22 May 2022 01:26:09 +0900 Subject: [PATCH 7/7] ccd --- .classpath | 2 +- .settings/org.eclipse.core.resources.prefs | 4 + bin/codingTest/Animal.class | Bin 489 -> 489 bytes bin/codingTest/Card.class | Bin 356 -> 0 bytes bin/codingTest/Eatable.class | Bin 210 -> 210 bytes bin/codingTest/Person.class | Bin 378 -> 378 bytes bin/codingTest/Solution$1.class | Bin 1389 -> 0 bytes bin/codingTest/Solution$2.class | Bin 1187 -> 0 bytes bin/codingTest/Solution$3.class | Bin 1271 -> 0 bytes bin/codingTest/Solution$4.class | Bin 1741 -> 0 bytes bin/codingTest/Solution.class | Bin 19225 -> 4437 bytes bin/codingTest/module.class | Bin 6093 -> 0 bytes bin/codingTest/module3.class | Bin 0 -> 811 bytes bin/module-info.class | Bin 149 -> 149 bytes src/codingTest/module2.java | 251 ++++++++++++++++++ src/codingTest/module3.java | 285 +++++++++++++++++++++ 16 files changed, 541 insertions(+), 1 deletion(-) create mode 100644 .settings/org.eclipse.core.resources.prefs delete mode 100644 bin/codingTest/Card.class delete mode 100644 bin/codingTest/Solution$1.class delete mode 100644 bin/codingTest/Solution$2.class delete mode 100644 bin/codingTest/Solution$3.class delete mode 100644 bin/codingTest/Solution$4.class delete mode 100644 bin/codingTest/module.class create mode 100644 bin/codingTest/module3.class create mode 100644 src/codingTest/module2.java create mode 100644 src/codingTest/module3.java diff --git a/.classpath b/.classpath index f00af9b..305deb8 100644 --- a/.classpath +++ b/.classpath @@ -5,6 +5,6 @@ - + diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..bb5f665 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +encoding//src/codingTest/module.java=UTF-8 +encoding//src/codingTest/module2.java=UTF-8 +encoding//src/codingTest/module3.java=UTF-8 diff --git a/bin/codingTest/Animal.class b/bin/codingTest/Animal.class index 7c34b71bff18d358734b61645d035cf0634a336e..e39fcc61116a82a78a0d81eb9bba01e997edb641 100644 GIT binary patch delta 17 ZcmaFK{F0gD)W2Q(7#J9=H*!2=1OP@22KN8} delta 17 ZcmaFK{F0gD)W2Q(7#J9AH*!2=1OP@C2KfL0 diff --git a/bin/codingTest/Card.class b/bin/codingTest/Card.class deleted file mode 100644 index f32a1e958833f15896d44153979a3bc8133d2697..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 356 zcmZ8d%}T>S7@SRFQ`4wv{HyljvF)LG0Dmq8p%4_bXtNtH1WMuMDXAP_)y|3 zdh)RIec$Xi%@8UZ^i ziDE9`RjxeP@O^Z#L&a#EY=aIyTy#v=_pyZznOK+Vrd_A1 zUdXgi0%2TbvPfjD&HP6?&775|HPF5ul)ZJnuWZN$BGmA8eOn$S3-kIna43_&w? zF!n^j(}l_5vAg4j#TriD(VGn4u=|3*d3Z(eOx8kZ?%)sy#1raH(Z>+`WR8B7IKUw% Nvu7OmJG?R4;~!}4Jjwt7 diff --git a/bin/codingTest/Eatable.class b/bin/codingTest/Eatable.class index 07b5ee60f286dce5a83c4b25a9fc488cfb6eda02..55b3850b3845db5d4124136d33356496ea9f6c64 100644 GIT binary patch delta 16 Ycmcb_c!`nY)W2Q(7#J9=Cvuzu06Vn?jQ{`u delta 16 Ycmcb_c!`nY)W2Q(7#J9ACvuzu06V<~j{pDw diff --git a/bin/codingTest/Person.class b/bin/codingTest/Person.class index e469ce485e4b1e7c3bcd23bbfd683c6ec8e8705c..ab2460a1cbb1cf01c376e50d811b97042e32cbda 100644 GIT binary patch delta 17 Zcmeyx^oxn()W2Q(7#J9=H*yp)0su!b2B-i4 delta 17 Zcmeyx^oxn()W2Q(7#J9AH*yp)0su!l2C4u6 diff --git a/bin/codingTest/Solution$1.class b/bin/codingTest/Solution$1.class deleted file mode 100644 index a0c1f9c0d0b031d0a7d7af7ceefcd0e455b723f4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1389 zcma)6TTc@~6#ix@EG>&v?q1NU6?&x<@mfHkf>bM*6iAFuOFP1n?M}11CGju#ppX6u zUo^28O^na}DC3#!8lYVh+e~Nn?3wR;=R4>0*Y9sX04$-bLSY!Iike~VZ*#}ZRfO4e z4PnLeDnbm=L;Xn4nYy)~+uA$iRaZqH!>DH^KQmVp^@eWiuCN*U+yldj&k9-Nt930thhF5QRucLOJPjnqKXS=WU0JyTwd33 z373hXXu2|e56%#|7lh>!BG>B$6<3H(XQ0)lVb-`EK@8VbTssTxQPFS%aiV*qn@zs; znqm4h-F8(9$!@+8Okr9oH$#k0U-2_c?n;lOh7{6N8oklrR*fMWov~)8w-<0A*1z_AT9Q z+Vp0z8>emQ7?aa}ekGQP-q4y=HHAa1_nf;2qNZYvh-GNCuzUjUWlF9xQ>jKT9(kt~ta^J9k7*BK4NvftPEtLohx|OFrC{w3uQ^U2 diff --git a/bin/codingTest/Solution$2.class b/bin/codingTest/Solution$2.class deleted file mode 100644 index 750138d5fe3bce85e44a735b88348040dbfffca5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1187 zcmZ`&T~8B16g@Lty0l$r1*CzcuLh%=0Jt>ovFw`J>8cp{JCiIo5E`ln!hBAr z8WuEJmu=6q9^0zqsg`WC9cxk1P~5uRbVbniXl1jXx@Wo6YY~1ADT(wW*L0*$y}V}y z$Fia0KDAmzFB(|K2E(8qb~{5Z_v}LKdf*XBH6LMPFm_$n^0pn}`xe!FaG&nYj`Rb} zP~*jD41i}csuO|Ci0VVSYn(<32CWVeTBrXQ&FMn%48w)e88U@;7eHfYop@>p9ofRw);-s#CMM8AZNPn4- sh9zQ6f&Id~ju^c}vP>q93K6Jz758Y?u!aYy5=s)K(x{$I8XRkX01BWMAOHXW diff --git a/bin/codingTest/Solution$3.class b/bin/codingTest/Solution$3.class deleted file mode 100644 index 695bef6115ea366bef8fffbf3bab224c010cbb8d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1271 zcmZuxTT|0e5dKaQ2(*D#u0lZ&tF$RlZlYMMU|?2mHXlSW&io!MlwyXV_)FQ>nLfBymCIbQ2f7{=>v!*ZG@!VmIQ*KP%t>!dey zXbj17e#!GTcbfU*+PSC)I{F#LLMz4D`I39_o_joSJ%;|^%<|K#1X$^TSYU`mSY7)hN(=?BjxNVgI01IVh{`o13CtzcE`XVVlk)~H4w)bgPM_{iHhZj zqt-=DcqhDO3x<)3Tj%yE_bmAx88u0iVX{}w^ac^t>tR`Relb(&w4fSz)ThF2OST-t z4DRWeC2pPgvJ;4=@C?jho?(C*x$`%)moDq8fRPSZkSb zJ6*;=7ABFUuC~PSJBA5zb&-qG7vfmLijL*KgA2zQ4UU>(AP*YaU{v#odxKwl@P#bR zOL5m^OFQhMj!4fsjg*trZZs`A-gW37ppK{itymi^Mgx9kU<%W;F;%za)y07&XBoe6 z8!cO`$n?awYBe1mv^?_c+(vI(ZtQ4xTtvM{<4){5b=&o6wud4(a~nGL7)E>Suz?a@ z5i38sC9BkqZ02oO_6W6{?O|jv%8nzvlFfZz&?pCv=*qou{Q&b+vr5tjC7G044kSn9 zj?*<&N#ZcbJ4D(xl+cneb5|HPXReSmzhdMQxfG1kv!4Q?&R~Lcc?d{g5_joM*9_AU z%m<3@Bb#Y{MlyGeRO1@=i}GVB`qF(3O-VFJHxOfpw3}PokvPt2s3TA z(V|R*i#4o=*-dParV#mAY*IlgQpD&nXO*jnlC-TQI&+`IetKY#uO;1Tu=qy*;r{-NUy_U$mL z^?Y|2Ilfn@8_)%EudFv#&9%HiZSUZf-H!}p1TM!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RzrTqtlRkZ;vi!i#d|zFi7ALXMk}GHE6?aT*)n z2*-}*9!;=EPW@n1mQ}`=n9kyMb76PEFVmgBH2ardRy@yCO@5#9IflQg_~yKYciusa zy<4Fc@+k>{sTjwnL?r@(7|(YeCZLEANqiGLgp1N%d+;lr;v)Oiit)* zI^E!T01@8L9{?L~t*;l8LcRfTh(3VUS})xY^3nqmwoPF7;ERWG83lf#)|)-}B*G^L za0SWzy(kFzZSqj9CeMoO*kSA-+0_JTq7T<>3~7D1Ry{wbo}Z^BHxlDZwf>M_4B#f} zB&oklljZv>_WM@8GtRhO;1Iqc{m|>8vKQ3mN%$drM}ofRLhzp2KqwIWK_3p*=7;iw zhx>6Kg*-?hKd#kfNIj65vynY56B=v4)fx`F|dg{}knCWIa73>&TF-XNF`wOIaCi z&ym|-$gLKhL4Jv88lKnif(C z*7ss;aY=kPyzYHh3QTgAi-1N@avls%{j zFY_dnntr(7g;!`U3gwWsg+545vR`dHfLDqa-vZCw^5EIPN;!;UEyex#`$4=Je5()t z>cfBfFnBMs`Xn2cMVr&jckOBx1SLo&k%(eoKl9OoZ7F#E7*irS&_%M>Ac38 zeTARtFS9P+R34e90=`oeD3ADY1+)1HhOitNFS$q^QeJYa43{%QVTnRJ{IlSB7o{3@ z4YGqX4Y*Zhl5ox-ZVT8sZgs!nY1S<{r-4Y8DLe78BxaDtDYy@Er~_YQ?p3Dh9y~ z29<0sRl?0la-9EPrzzuQxl#=lvmAi(B%6sGiYvr;Iz$%D3Ne8vH~-WtCwVAgnJ6O6 zOBvI}M4o)A4hrCTj~zk0i=Zfc2j0SfTqkUsEBTg;U8>kzs@O8Kc$-osGmBjugHHma zh54C-#eJewriznlzeA*-B4shS#Z-wU qP7%}ip2pvE`L9e=h)Q*uFBXbL>QpV3iW;$uSaKOURn&@lg#HUeYWzb0 diff --git a/bin/codingTest/module3.class b/bin/codingTest/module3.class new file mode 100644 index 0000000000000000000000000000000000000000..29101c29f0c752449ba44052a2b3afde45357f27 GIT binary patch literal 811 zcmZuvU2hUm5Iq-m*=41ckG9%c#gD4cV(FLI1fwPRwhUwhau*7l${U8R z@-3v1G%$0C__)l(oWOj0ePeU$U|0FF)OcIklj_)$rB^bLCaw!4+m9Mjr;D?5A)Ox469;QjFO#Jy(_Y$Sve3>GZ1+joT^Q!Ce7sFyXdVp>~CKtyZjA zSi%DX_qoJqyUXP%JVZgjIF34cR6#4$MoK%uAr;I0M-lJ|k^+h~Ke#B*KJP$=I6K7%@ gD=3l86gKgQu^6#SSmi0sx;)oggU0+i(J^fN0ZgN*WdHyG literal 0 HcmV?d00001 diff --git a/bin/module-info.class b/bin/module-info.class index 9fa0d8a184f57812a1a1ef285c5fe7f823a764dd..845d9c6614d1e9614c4e81f6c28920d1dd93cd5c 100644 GIT binary patch delta 16 YcmbQrIF*s()W2Q(7#J9=Cvx-x05nns)&Kwi delta 16 YcmbQrIF*s()W2Q(7#J9ACvx-x05n true); //filter + + //stream filter 후 list 반환 + //ArrayList alreadyRankUser = (ArrayList) arr1.stream().filter(t -> t[0].equals(userName) && Integer.parseInt(t[1]) >= userScore).collect(Collectors.toList()); + + List list1 = new ArrayList(); + + + list1.add(new Integer[][] {{1,3}}); + + //List + List list2 = new ArrayList(); + int index1 = 0; + list2.add(index1, 0); + list2.remove(index1); + for (Integer integer : list2) { + System.out.println(integer); + } + + //List Sort + Collections.sort(list2,new Comparator() { + public int compare(Object o1,Object o2) { +// Object v1 = map.get(o1); +// Object v2 = map.get(o2); +// +// if(v1.equals(v2)) { +// return ((Comparable) o1).compareTo(o2); +// } + + return ((Comparable) o1).compareTo(o2); + } + }); + + //map 선언 -> key 중복 x + HashMap map = new HashMap(); + + HashMap> ma2 = new HashMap>(); + + //ma2.put("aa", new List); + + for(String key : map.keySet()) { + + } + + //HashSet -- 중복 미허용 + Set set1 = new HashSet(); + + + + + //Stack + Stack stack = new Stack(); + stack.add(null); //넣기 + stack.empty(); //비었는지 확인 + stack.peek(); //stack 최상단 값 + stack.pop(); //stack 빼기 + + //Queue + Queue queue = new LinkedList<>(); + queue.add(null); //넣기 + queue.isEmpty(); //비었는지 확인 + queue.peek(); //queue 나올 값 + queue.poll(); //queue 빼기 + + //Deque + ArrayDeque dq = new ArrayDeque<>(50505); + dq.isEmpty(); + dq.add(null); + dq.addFirst(null); + dq.addLast(null); + dq.peekFirst(); + dq.peekLast(); + dq.pollFirst(); + dq.pollLast(); + + //PriorityQueue + PriorityQueue maxPq = new PriorityQueue(Collections.reverseOrder()); //최대우선순위큐 + PriorityQueue minPq = new PriorityQueue(); //최소우선순위큐 + PriorityQueue> pqh = new PriorityQueue>(new Comparator>() { + + @Override + public int compare(HashMap o1, HashMap o2) { + + int size1 = Integer.parseInt(o1.get("size")); + int size2 = Integer.parseInt(o2.get("size")); + String name1 = o1.get("name"); + String name2 = o2.get("name"); + + + if(size1 != size2) { + return ((Comparable) size1).compareTo(size2); + } else { + return ((Comparable) name1).compareTo(name2); + } + + } + + }); + + + maxPq.add(null); + maxPq.peek(); //head + maxPq.poll(); //빼기 + maxPq.isEmpty(); //비었는지 + maxPq.remove(); //삭제 + + //변환 + //List -> int[]; + int[] arr99 = {}; + List list99 = new ArrayList(); + arr99 = list99.stream().mapToInt(i->i).toArray(); + + //int[] -> List + int[] arr100 = {}; + List list100 = Arrays.stream(arr100).boxed().collect(Collectors.toList()); + + //Integer[] -> List + Integer[] arr101 = {}; + List list101 = Arrays.asList(arr101); + + + //String + String str1 = "ABC"; + str1.charAt(1); + + + + + } + + public static boolean isPrime(int num){ + for(int i=2; i<=num/2; i++){ + if(num % i == 0) return false; + } + return true; + } + + + static ArrayList[] a; + static boolean[] c; + public static void dfs(int x) { + if (c[x]) { + return; + } + c[x] = true; + System.out.print(x + " "); + for (int y : a[x]) { + if (c[y] == false) { + dfs(y); + } + } + } + public static void bfs(int start) { + Queue q = new LinkedList(); + q.add(start); + c[start] = true; + while (!q.isEmpty()) { + int x = q.remove(); + System.out.print(x + " "); + for (int y : a[x]) { + if (c[y] == false) { + c[y] = true; + q.add(y); + } + } + } + } + + public boolean BinarySearch(int []arr, int len, int key){ + int start = 0; + int end = len-1; + int mid; + + while(end - start >= 0) { + mid = (start + end) / 2; //중앙 값 + + if (arr[mid] == key) { //key값을 찾았을때 + return true; + + } else if (arr[mid] > key) { //key값이 mid의 값보다 작을때 (왼쪽으로) + end = mid - 1; + + } else { //key값이 mid의 값보다 클때 (오른쪽으로) + start = mid + 1; + + } + } + return false; + } + + static boolean isStringInt(String a) { + try { + Integer.parseInt(a); + return true; + } catch (NumberFormatException ex) { + return false; + } + } + + +} + +class Solution { + + public static void solution01() { + + } + + public static void solution02() { + + } + + public static void solution03() { + + } + +} \ No newline at end of file diff --git a/src/codingTest/module3.java b/src/codingTest/module3.java new file mode 100644 index 0000000..71690dd --- /dev/null +++ b/src/codingTest/module3.java @@ -0,0 +1,285 @@ +package codingTest; + +import java.util.*; +import java.util.Map.Entry; +import java.util.stream.Collectors; + +public class module3 { + + public static void main(String[] args) { + + //문제풀이 기본 양식 + Solution s = new Solution(); + String[] answer = {}; + + + // + String[] rooms= {"[1234]None,Of,People,Here", "[5678]Wow"}; + int target = 1234; + + +// System.out.println(s.solution01(new String[] {"I 16","D 1"})); +// System.out.println(s.solution02(new String[] {"I 16","D 1"})); + + + //System.out.println(s.solution03(new int[] {2,3,1,4}, 3)); + //System.out.println(s.solution03(new int[] {1,2,3,4}, 5)); +// System.out.println(s.solution06(new int[] {2,3,1,4}, 3)); + System.out.println(s.solution06(new int[] {1,2,3,4}, 5)); +// System.out.println(s.solution06(new int[] {1,2,3,4}, 20)); + + } + +} + +class Solution { + + public static int[][] map; + public static boolean[] visited; + public static int max; + public static int n; + + +public static int solution01(int[][] board) { + int answer = 0; + + int m = board[0].length; // 가로 + int n = board.length; // 세로 + int sum = 0; // 전체 타일 과자 총합 + int min = 1001; // 포기할 타일 중 최소값 + + //전체 총합 구하기 + for (int[] line : board) { + sum += Arrays.stream(line).sum(); + } + + //전부 갈 수 있는 경우, 총합 리턴 + if(m % 2 == 1 || n % 2 == 1) { + return sum; + } + + //못 가는 타일 1개 고르기 + for(int i = 0; i < n; i++) { + for(int j = 0; j hm = new HashMap<>(); + + + for (int i=0 ; i queue = new LinkedList(); + + int sum = Arrays.stream(play_list).sum(); + + if(sum < listen_time) { + return play_list.length; + } + + int maxCount = 0; + int tmpSum = 0; + int count = 0; + for(int i = 0; i < play_list.length ; i++) { + System.out.println("start ============ : " + i ); + int j = i; + count = 0; + tmpSum = 0; + while(true) { + if(j == i) { + tmpSum += 1; + count++; + } else { + System.out.println("add : " + play_list[j%play_list.length]); + tmpSum += play_list[j%play_list.length]; + count++; + } + j++; + System.out.println(tmpSum); + + if(tmpSum > listen_time) { + break; + } + } + + maxCount = Math.max(maxCount, count); + + System.out.println("max : " + maxCount); + } + + answer = maxCount; + return answer; + + } + + + public int solution04(int[] play_list, int listen_time) { + + int answer = 0; + + int sum = Arrays.stream(play_list).sum(); + + if(listen_time <= 2) { + return Math.min(play_list.length, listen_time); + } + + if(sum < listen_time) { + return play_list.length; + } + + int maxCount = 0; + int tmpSum = 0; + int count = 0; + HashSet set = new HashSet<>(); + for(int i = 0; i < play_list.length ; i++) { + System.out.println("start ============ : " + i + " / " + play_list[i]); + int j = i; + count = 0; + tmpSum = 0; + set = new HashSet<>(); + while(true) { + if(j == i) { + tmpSum += 1; + } else { + System.out.println("add : " + play_list[j%play_list.length]); + tmpSum += play_list[j%play_list.length]; + } + j++; + System.out.println(tmpSum); + set.add(j%play_list.length); + if(tmpSum > listen_time) { + break; + } + } + + maxCount = Math.max(maxCount, set.size()); + + System.out.println("max : " + maxCount); + } + + answer = maxCount; + return answer; + + } + + public int solution05(int[] play_list, int listen_time) { + int answer = 0; + + int sum = Arrays.stream(play_list).sum(); + Queue queue = new LinkedList(); + + if(listen_time <= 2) { + return Math.min(play_list.length, listen_time); + } + + if(sum < listen_time) { + return play_list.length; + } + + for(int i = 0; i < play_list.length; i++) { + + } + + + return answer; + } + + + public int solution06(int[] play_list, int listen_time) { + + int answer = 0; + + int[] s = new int[play_list.length]; //s = 그냥 앞에서부터 음악시간 더한 배열 + int s2 = 0; + int s3 = 0; + + s[0] = play_list[0]; + + for(int i = 1; i < play_list.length; i++) { + s[i] = play_list[i-1] + play_list[i]; + } + + int start = 0; + int end = play_list.length-1; + int mid = 0; + + boolean flag = false; + + while(start<=end) { + mid = (start+end)/2; + flag = false; + System.out.println("start : " + start + " mid : " + mid + " end : " + end); + + for(int i = answer; i <= end ;i++){ + if(i-1 > -1) { + s2 = s[i-1] + 1; + } else { + s2 = 1; + } + s3 = s[i-answer] - (play_list[i] > 1 ? 1 : 0); + + if(s2 - s3 <= listen_time) { + start = mid + 1; + + if(mid >= answer) { + answer= mid; + } + flag=true; + break; + } + } + + if(!flag){ + end=mid-1; + } + + } + + return answer; + } + + +} \ No newline at end of file