본문 바로가기

Algorithm/Leet Code

(124)
LeetCode #287 FindTheDuplicateNumber. Algorithm,알고리즘,LeetCode,Codefights,CodeSignal,코드파이트,코드시그널,예제,문제해결능력,example,c++,java,재귀,recursive,datastructure,techinterview,coding,코딩인터뷰,기술면접, dyna.. LeetCode #287 FindTheDuplicateNumber. Algorithm,알고리즘,LeetCode,Codefights,CodeSignal,코드파이트,코드시그널,예제,문제해결능력,example,c++,java,재귀,recursive,datastructure,techinterview,coding,코딩인터뷰,기술면접, dynamicProgramming 퍼포먼스 99프로 99% performance LeetCode #287 Q. Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Ass..
LeetCode #540 SingleElementInASortedArray. Algorithm,알고리즘,LeetCode,Codefights,CodeSignal,코드파이트,코드시그널,예제,문제해결능력,example,c++,java,재귀,recursive,datastructure,techinterview,coding,코딩인터뷰,기술면접 LeetCode #540 SingleElementInASortedArray. Algorithm,알고리즘,LeetCode,Codefights,CodeSignal,코드파이트,코드시그널,예제,문제해결능력,example,c++,java,재귀,recursive,datastructure,techinterview,coding,코딩인터뷰,기술면접 생각나는데로 풀이과정 정리안하고 막풀었더니 코드는 지저분한데 성능은 잘 나옴 LeetCode #540 Q. Given a sorted array consisting of only integers where every element appears twice except for one element which appears once. Find this single element ..
LeetCode #455 AssignCookies. Algorithm,알고리즘,LeetCode,Codefights,CodeSignal,코드파이트,코드시그널,예제,문제해결능력,example,c++,java,재귀,recursive,datastructure,techinterview,coding,코딩인터뷰,기술면접 LeetCode #455 AssignCookies. Algorithm,알고리즘,LeetCode,Codefights,CodeSignal,코드파이트,코드시그널,예제,문제해결능력,example,c++,java,재귀,recursive,datastructure,techinterview,coding,코딩인터뷰,기술면접 처음에 금방 푼 게 퍼포먼스가 너무 안 좋아서 중상 정도로 올리는데 시간 좀 걸림 병합정렬과 비슷한 방법이다. First solution had too bad performance, so i spent some time for tunning to upper mid performance It's similar with merge sort LeetCode #455 Q. Assume you are an a..
LeetCode #451 SortCharactersByFrequency. Algorithm,알고리즘,LeetCode,Codefights,CodeSignal,코드파이트,코드시그널,예제,문제해결능력,example,c++,java,재귀,recursive,datastructure,techinterview,coding,코딩인터뷰,기술면접 LeetCode #451 SortCharactersByFrequency. Algorithm,알고리즘,LeetCode,Codefights,CodeSignal,코드파이트,코드시그널,예제,문제해결능력,example,c++,java,재귀,recursive,datastructure,techinterview,coding,코딩인터뷰,기술면접 ascii 를 이용해서 다이나믹식으로 풀었는데, 정렬을 직접 해줘야해서 귀찮았지만 퍼포먼스 개잘나옴. 뿌듯.. Did it using dynamic programming, it was kinda lazy cuz I had to do sort by myself.. but performance is hella good. So.. worth it LeetCode #451Q. Given..
LeetCode #442 FindAllDuplicatesInAnArray. Algorithm,알고리즘,LeetCode,Codefights,CodeSignal,코드파이트,코드시그널,예제,문제해결능력,example,c++,java,재귀,recursive,datastructure,techinterview,coding,코딩인터뷰,기술면접 LeetCode #442 FindAllDuplicatesInAnArray. Algorithm,알고리즘,LeetCode,Codefights,CodeSignal,코드파이트,코드시그널,예제,문제해결능력,example,c++,java,재귀,recursive,datastructure,techinterview,coding,코딩인터뷰,기술면접 부가적으로 제시한 제한 조건에 딱 맞는 것을 딱히 못 떠올려서 성능/메모리 둘다 안좋음 LeetCode #442Q. Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements that appear ..
LeetCode #292 NimGame. Algorithm,알고리즘,LeetCode,Codefights,CodeSignal,코드파이트,코드시그널,예제,문제해결능력,example,c++,java,재귀,recursive,datastructure,techinterview,coding,코딩인터뷰,기술면접 LeetCode #292 NimGame. Algorithm,알고리즘,LeetCode,Codefights,CodeSignal,코드파이트,코드시그널,예제,문제해결능력,example,c++,java,재귀,recursive,datastructure,techinterview,coding,코딩인터뷰,기술면접 술게임 베스킨라빈스 할때 생각했던거랑 똑같음 It's almost same with drinking game "Baskin robins 31" in Korea LeetCode #292Q. You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take tur..
LeetCode #283 MoveZeroes #2. Algorithm,알고리즘,LeetCode,Codefights,CodeSignal,코드파이트,코드시그널,예제,문제해결능력,example,c++,java,재귀,recursive,datastructure,techinterview,coding,코딩인터뷰,기술면접 LeetCode #283 MoveZeroes #2. Algorithm,알고리즘,LeetCode,Codefights,CodeSignal,코드파이트,코드시그널,예제,문제해결능력,example,c++,java,재귀,recursive,datastructure,techinterview,coding,코딩인터뷰,기술면접 쉬운거 한개만 빨리 푸려고 아무거나 풀었는데 풀고 저장하려고 보니 예전에 풀었던거.. 이번에 그냥 푼게 퍼포먼스 더 잘나옴.. (32ms -> 20ms) I just picked and solved easy one, but it was what i was solved in the past... Anyway, it's better performance. (32ms -> 20ms) LeetCode #28..
LeetCode #637 AverageOfLevelsInBinaryTree. Algorithm,알고리즘,LeetCode,Codefights,CodeSignal,코드파이트,코드시그널,예제,문제해결능력,example,c++,java,재귀,recursive,datastructure,techinterview,coding,코딩인터뷰,기술면접 LeetCode #637 AverageOfLevelsInBinaryTree. Algorithm,알고리즘,LeetCode,Codefights,CodeSignal,코드파이트,코드시그널,예제,문제해결능력,example,c++,java,재귀,recursive,datastructure,techinterview,coding,코딩인터뷰,기술면접 퍼포먼스 개잘나옴 Performance is good af LeetCode #637Q. Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array. 비어있지 않은 이진트리가 주어지고, 배열의 형태로 되어있는 각 레벨의 노드들 값의 평균을 반환해라..