Trees Tree is slightly more complex than linked list, because the latter(후자) is a linear data structure while the former is not. Tree problems can be solved either breadth-first or depth-first. We have one problem here which is great for practicing breadth-first traversal. We recommend: Maximum Depth of Binary Tree, Validate Binary Search Tree, Binary Tree Level Order Traversal and Convert Sorte..
Strings String type of questions were asked in interviews frequently. You will most likely encounter one during your interviews. We recommend: Reverse String, First Unique Character in a String, String to Integer (atoi) Implement strStr(). 총 8문제. 344. Reverse String 투포인터는 이렇게 쓰는 것이다. 이런 느낌의 문제. leetcode.com/problems/reverse-string/solution/ Easy Write a function that reverses a string. The input..
Array Array type of questions were asked in interviews frequently. You will most likely encounter one during your interviews. We recommend: Single Number, Rotate Array, Intersection of Two Arrays II and Two Sum 26. Remove Duplicates from Sorted Array leetcode.com/problems/remove-duplicates-from-sorted-array/ Given a sorted array nums, remove the duplicates in-place such that each element appear ..
Conclusion We hope you're now feeling confident with the basics of Arrays! Because practice makes perfect, here are a few more practice problems for you! What's Next? Let's recap what we looked at in this explore card: We explored what the Array data structure is all about. We looked at the Java syntax for creating Arrays. We looked at the Java syntax for reading and writing from Arrays. We desi..
In-Place Operations Now that we've got all the basic Array operations out of the way, we're going to have a look at in-place Array operations. These are very important from an interviewing standpoint. In-place Array operations are where we modify an Array, without creating a new Array. We've already seen some examples of this: inserting and removing items by shifting existing items along. There ..
Inserting Items Into an Array In the previous chapter, we looked at what Arrays are, and the basic programming constructs of Arrays in Java. We're now going to use these basic constructs to implement three key operations for Arrays: Inserting items. Removing items. Searching for items. These three operations are the fundamental operations for all data structures. In this chapter, we'll be starti..
Introduction to Data Structure Overview Introduction Arrays are a simple data structure for storing lots of similar items. They exist in all programming languages, and are used as the basis for most other data structures. On their own, Arrays can be used to solve many interesting problems. Arrays come up very often in interview problems, and so being a guru with them is a must! In this Explore C..
leetcode.com/problems/maximum-depth-of-binary-tree/ 보통 마지막 솔루션이 더 옵티멀한거여서 봤는데, 특별한것이 없었다; Approach 1: Recursion Intuition By definition, the maximum depth of a binary tree is the maximum number of steps to reach a leaf node from the root node. From the definition, an intuitive idea would be to traverse the tree and record the maximum depth during the traversal. Algorithm 1 / 10 One could travers..
leetcode.com/problems/shortest-word-distance/ n^2으로 풀면 안된다. class Solution { public int shortestDistance(String[] words, String word1, String word2) { int i1 = -1, i2 = -1; int minDistance = words.length; for (int i = 0; i < words.length; i++) { if (words[i].equals(word1)) { i1 = i; } else if (words[i].equals(word2)) { i2 = i; } if (i1 != -1 && i2 != -1) { minDistance = Math.min(minDistance, Mat..
leetcode.com/problems/the-kth-factor-of-n/ The kth Factor of n - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 금요일이라고 쉬운문제인건가 싶었지만, 그렇지 않았음 In this article, we consider three solutions. Approach 1: Brute Force, \mathcal{O}(N)O(N). One could iterate from 11 to NN, figure out all d..
events.withgoogle.com/google-for-startups-accelerator-women-founders-demo-day-2020/ Google for Startups Accelerator: Women Founders - Demo Day - Demo Day The Google for Startups Accelerator Women Founders is a three-month digital accelerator program for Seed to Series A technology startups based in Canada and the US. The accelerator is designed to bring the best of Google’s products, people and ..
leetcode.com/contest/weekly-contest-215 Contest - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 1656. Design an Ordered Stream class OrderedStream { String[] streamList; int ptr; public OrderedStream(int n) { streamList = new String[n]; ptr = 0; } public List insert(int id, Strin..
leetcode.com/problems/min-cost-climbing-stairs/ Min Cost Climbing Stairs - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com class Solution { public int minCostClimbingStairs(int[] cost) { int f1 = 0, f2 = 0; for(int i = cost.length - 1; i >= 0; --i) { int f0 = cost[i] + Math.min(f1,..
leetcode.com/problems/increasing-order-search-tree/ Increasing Order Search Tree - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com Approach 1: In-Order Traversal class Solution { public TreeNode increasingBST(TreeNode root) { List vals = new ArrayList(); inorder(root, vals); TreeNo..
SqlSum Elementry SELECT sum(v) FROM elements; StrSymmetryPoint Painless Find a symmetry point of a string, if any. class Solution { public int solution(String S) { int sLen = S.length(); if ((sLen & 1) == 0) { return -1; } final int result = sLen / 2; for (int i = result, j = result; j >= 0; i++, j--) { if (S.charAt(i) != S.charAt(j)) { return -1; } } return result; } } TreeHeight Painless class..
[Leetcode] 419. Battleships in a Board leetcode.com/problems/battleships-in-a-board/ Battleships in a Board - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 요렇게 생각할 수 있겠으나 class Solution { public int countBattleships(char[][] board) { int res = 0, m = board.length, n = board[0].le..
leetcode.com/problems/random-pick-index/ Random Pick Index - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com Given an array of integers with possible duplicates, randomly output the index of a given target number. You can assume that the given target number must exist in the array...
www.geeksforgeeks.org/reservoir-sampling/ Reservoir Sampling - GeeksforGeeks A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions. www.geeksforgeeks.org leetcode.com/problems/linked-list-random-node/ Linked List Random Node - LeetCode Level..
MinAbsSum Ambitious Given array of integers, find the lowest absolute sum of elements. app.codility.com/programmers/lessons/17-dynamic_programming/min_abs_sum/ MinAbsSum coding task - Learn to Code - Codility Given array of integers, find the lowest absolute sum of elements. app.codility.com N 개의 정수로 구성된 배열 A와 {-1, 1} 집합에서 N 개의 정수로 구성된 시퀀스 S에 대해 다음과 같이 val (A, S)를 정의합니다. val (A, S) = | sum {A [i..
[100%] FrogRiverOne Find the earliest time when a frog can jump to the other side of a river. Respectable [100%] MaxCounters Calculate the values of counters after applying all alternating operations: increase counter by 1; set value of all counters to current maximum. Respectable [100%] MissingInteger Find the smallest positive integer that does not occur in a given sequence. Painless // you ca..
한번에 다운받을 수 있다. (2020년 11월 30일 버전) 출처: app.codility.com/programmers/lessons/1-iterations/ 1. Iterations lesson - Learn to Code - Codility Find longest sequence of zeros in binary representation of an integer. app.codility.com
leetcode.com/contest/weekly-contest-217 Contest - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com leetcode.com/problems/richest-customer-wealth/ Richest Customer Wealth - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge an..
docs.oracle.com/en/java/javase/index.html Java Platform, Standard Edition Documentation - Releases Java Platform, Standard Edition documentation, current and previous releases docs.oracle.com 공식 튜토리얼이지만 JDK 8 기준이다. docs.oracle.com/javase/tutorial/collections/index.html Trail: Collections (The Java™ Tutorials) The Java Tutorials have been written for JDK 8. Examples and practices described in thi..
Design a queue that supports push and pop operations in the front, middle, and back. Implement the FrontMiddleBack class: FrontMiddleBack() Initializes the queue. void pushFront(int val) Adds val to the front of the queue. void pushMiddle(int val) Adds val to the middle of the queue. void pushBack(int val) Adds val to the back of the queue. int popFront() Removes the front element of the queue a..
leetcode.com/contest/biweekly-contest-40 Contest - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 4개는 언제 풀수있을까...ㅜ
나는 최근에 이상한 일을 하고 있다. 예전의 나와 경쟁... 오늘은 2019년 2월 10일 나와의 경쟁. leetcode.com/contest/weekly-contest-123 Contest - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com class Solution { public List addToArrayForm(int[] A, int K) { int n = A.length; int c = K; for(int i = A.length-1;i >= 0;i--)..
leetcode.com/contest/weekly-contest-191 Contest - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 실력이 좀 늘었나? 하고 생각했지만, 3문제가 워낙 쉬웠던것 같다. leetcode.com/contest/weekly-contest-191/ranking/161/ Contest - LeetCode Level up your coding skills and quickly land a job. This is the best place..