프로그래밍 대회에서 사용하는 Java 프로그래밍 대회에서 사용하는 Java에 관련된 내용을 배웁니다. 먼저, Java에서 입/출력을 하는 방법을 배웁니다. Scanner, BufferedReader, StringTokenizer, StringBuilder 에 대해서 알아봅니다. 그 다음, Java의 Collections에 대해서 알아봅니다.( ArrayList, LinkedList, Stack, Set, Map, Queue, PriorityQueue) 세 번째로 Java에서 정렬하는 방법인 Comparator와 Comparable에 대해서 알아봅니다. 마지막으로, 큰 수를 다루는 BigInteger와 BigDecimal을 알아봅니다. 강의는 설명과 문제 실습으로 이루어져 있습니다. 포함되어 있는 문제 1..
프로그래밍 대회에서 사용하는 C, C++, STL 프로그래밍 대회에서 사용하는 C, C++, STL에 관련된 내용을 배웁니다. C에서는 scanf/printf 의 사용법에 대해서 주로 배웁니다. C++에서는 getline, setprecision과 같이 cin,cout의 사용법을 배웁니다. 이후에는 C++11에 해당하는 내용은 auto, Range-based for, 초기화 리스트, 람다 함수을 배웁니다. STL은 Container와 Algorithm으로 나누어져 있습니다. Container에서는 pair, tuple, vector, deque, list, set, map, stack, queue, priority_queue, bitset에 대해서 알아봅니다. Algorithm에서는 count, find..
leetcode.com/problems/spiral-matrix-ii/ Spiral Matrix II - 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 Overview There are various problems in spiral matrix series with some variations like Spiral Matrix and Spiral Matrix III. In order to solve such questions, the core idea is t..
Others Here are some other questions that do not fit in other categories. We recommend: Trapping Rain Water and The Skyline Problem. If you'd like more challenge, we highly recommend you to solve the last two problems: The Skyline Problem and Largest Rectangle in Histogram. Both problems are very fun to solve and can be solved with many different approaches. Queue Reconstruction by Height Trappi..
Math Most of the math questions asked in interviews do not require math knowledge beyond middle school level. We recommend Max Points on a Line. Largest Number Max Points on a Line leetcode.com/problems/largest-number/solution/ leetcode.com/problems/max-points-on-a-line/solution/
Design These problems may require you to implement a given interface of a class, and may involve using one or more data structures. These are great exercises to improve your data structure skills. We recommend: LRU Cache, Implement Trie (Prefix Tree) and Find Median from Data Stream. LRU Cache Implement Trie (Prefix Tree) Flatten Nested List Iterator Find Median from Data Stream Range Sum Query ..
Dynamic Programming Here are some classic Dynamic Programming interview questions. We recommend: Best Time to Buy and Sell Stock with Cooldown and Word Break. Burst Balloons is a great problem too, highly recommended for the more advanced level. Maximum Product Subarray Decode Ways Best Time to Buy and Sell Stock with Cooldown Perfect Squares Word Break Word Break II Burst Balloons leetcode.com/..
Sorting and Searching These problems deal with sorting or searching in a sorted structure. We recommend: Median of Two Sorted Arrays. Hands down one of the best interview questions. Wiggle Sort II Kth Smallest Element in a Sorted Matrix Median of Two Sorted Arrays leetcode.com/problems/wiggle-sort-ii/ leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix/solution/ leetcode.com/problems/m..
Backtracking Here are some of the best backtracking interview questions. We recommend: Word Search II, Remove Invalid Parentheses and Regular Expression Matching. Palindrome Partitioning Word Search II Remove Invalid Parentheses Wildcard Matching Regular Expression Matching leetcode.com/problems/palindrome-partitioning/solution/ leetcode.com/problems/word-search-ii/solution/ leetcode.com/problem..
Trees and Graphs Tree is a special type of graphs, so the two usual techniques used to traverse a graph are also applicable to trees. We recommend: Word Ladder, Lowest Common Ancestor of a Binary Tree, Course Schedule, Longest Increasing Path in a Matrix and Alien Dictionary. Note that some of the tree problems can also be asked in n-ary tree format, so make sure you know what an n-ary tree is. ..
Linked List There are not a lot of difficult Linked List problems. However, these Linked List problems do require some thought. We recommend all of these problems, all of them are classic Linked List interview questions, especially Copy List with Random Pointers which may seem impossible to solve at first glance. Merge k Sorted Lists Sort List Copy List with Random Pointer leetcode.com/problems/..
Array and Strings Array and String type of questions were asked in interviews frequently. You will most likely encounter one during your interviews. We recommend: Product of Array Except Self, Spiral Matrix, First Missing Positive, Longest Substring with At Most K Distinct Characters, Sliding Window Maximum and Minimum Window Substring. The last three problems are a bit more challenging, so feel..
Introduction This is LeetCode's official curated list of Top classic interview questions to help you land your dream job. Our top interview questions are divided into the following series: Easy Collection Medium Collection Hard Collection to help you master Data Structure & Algorithms and improve your coding skills. Just like any other skills, coding interview is one area where you can greatly i..
leetcode.com/contest/weekly-contest-218 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 1번 leetcode.com/problems/goal-parser-interpretation/ Goal Parser Interpretation - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your kno..
Others Here are some other questions that do not fit in other categories. We recommend: Majority Element, Find the Celebrity and Task Scheduler. Sum of Two Integers Evaluate Reverse Polish Notation Majority Element Find the Celebrity Task Scheduler
Math Most of the math questions asked in interviews do not require math knowledge beyond middle school level. We recommend: Excel Sheet Column Number, Pow(x, n) and Divide Two Integers. Happy Number Factorial Trailing Zeroes Excel Sheet Column Number Pow(x, n) Sqrt(x) Divide Two Integers Fraction to Recurring Decimal
Design These problems may require you to implement a given interface of a class, and may involve using one or more data structures. These are great exercises to improve your data structure skills. We recommend: Serialize and Deserialize Binary Tree and Insert Delete GetRandom O(1). Flatten 2D Vector Serialize and Deserialize Binary Tree Insert Delete GetRandom O(1) Design Tic-Tac-Toe
Dynamic Programming Here are some classic Dynamic Programming interview questions. We recommend: Unique Paths, Coin Change and Longest Increasing Subsequence. Jump Game Unique Paths Coin Change Longest Increasing Subsequence ♣ 파이썬만 풀어봄 : inner-game.tistory.com/443
Sorting and Searching These problems deal with sorting or searching in a sorted structure. We recommend: Sort Colors, Search for a Range, Merge Intervals, Search in Rotated Sorted Array, Meeting Rooms II and Search a 2D Matrix II. Sort Colors Top K Frequent Elements Kth Largest Element in an Array Find Peak Element Search for a Range Merge Intervals Search in Rotated Sorted Array Meeting Rooms I..
Backtracking Here are some of the best backtracking interview questions. Letter Combinations of a Phone Number and Generate Parentheses are both great interview questions. Also make sure you are able to write code to generate permutations / subsets (combinations), those are great backtracking exercises too. Letter Combinations of a Phone Number Generate Parentheses Permutations Subsets Word Sear..
Trees and Graphs Tree is a special type of graphs, so the two usual techniques used to traverse a graph are also applicable to trees. We recommend: Binary Tree Inorder Traversal, Populating Next Right Pointers in Each Node and Number of Islands. Note that some of the tree problems can also be asked in n-ary tree format, so make sure you know what an n-ary tree is. Note: Although Number of Island..
Linked List Linked List problems are relatively easy to master. Do not forget the Two-pointer technique, which not only applicable to Array problems but also Linked List problems as well. Another technique to greatly simplify coding in linked list problems is the dummy node trick. We recommend: Add Two Numbers and Intersection of Two Linked Lists. iterative recursive Add Two Numbers * 10/18, 12/..
Array and Strings Array and String type of questions were asked in interviews frequently. You will most likely encounter one during your interviews. We recommend: Group Anagrams, Longest Substring Without Repeating Characters, Longest Palindromic Substring and Missing Ranges. 3Sum Set Matrix Zeroes Group Anagrams Longest Substring Without Repeating Characters Longest Palindromic Substring Increa..
leetcode.com/problems/populating-next-right-pointers-in-each-node-ii/ Populating Next Right Pointers in Each Node II - 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 솔루션2로 풀도록 할것. Given a binary treestruct Node { int val; Node *left; Node *right; Node *next; } Populate each next p..
leetcode.com/problems/can-place-flowers/ Can Place Flowers - 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 문제는 쉽다. and 와 or을 잘 이해하고, 조건문을 얼마나 아름답게 쓰냐의 차이.. public class Solution { public boolean canPlaceFlowers(int[] flowerbed, int n) { int i = 0, count = 0; while (i < flowerbed...
Others Here are some other questions that do not fit in other categories. We recommend: Number of 1 Bits Valid Parentheses. 191. Number of 1 Bits leetcode.com/problems/number-of-1-bits/ Write a function that takes an unsigned integer and returns the number of '1' bits it has (also known as the Hamming weight). Note: Note that in some languages such as Java, there is no unsigned integer type. In ..
Math Most of the math questions asked in interviews do not require math knowledge beyond middle school level. We recommend: Count Primes Power of Three. 412. Fizz Buzz leetcode.com/problems/fizz-buzz/ 피즈버즈 하나 가지고도 이런 다양한 토론을 할수 있군.. Solution You must have played FizzBuzz as kids. FizzBuzz charm never gets old. And so here we are looking at how you can take on one step at a time and impress your ..
Design These problems may require you to implement a given interface of a class, and may involve using one or more data structures. These are great exercises to improve your data structure skills. We recommend: Shuffle an Array Min Stack. 384. Shuffle an Array leetcode.com/problems/shuffle-an-array/ Initial Thoughts Normally I would display more than two approaches, but shuffling is deceptively ..
Dynamic Programming Here are some classic Dynamic Programming interview questions. We recommend: Climbing Stairs, Best Time to Buy and Sell Stock and Maximum Subarray. 70. Climbing Stairs leetcode.com/problems/climbing-stairs/solution/ 3번으로 풀었다. 4번부터 쬐끔 당황쓰. Summary You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many disti..
Sorting and Searching These problems deal with sorting or searching in a sorted structure. We recommend First Bad Version as a great introduction to a very important algorithm. 88. Merge Sorted Array leetcode.com/problems/merge-sorted-array/ Solution Approach 1 : Merge and sort Intuition The naive approach would be to merge both lists into one and then to sort. It's a one line solution (2 lines ..