Data structure and Algo solutions. The problems are based on LeetCode and freeCodecamp - GitHub - ammahith/DSA-Solutions: Data structure and Algo solutions. The problems are based on LeetCode and freeCodecamp
2468.Split-Message-Based-on-Limit (H-) Abbreviation 408.Valid-Word-Abbreviation (M) 411.Minimum-Unique-Word-Abbreviation (H) 527.Word-Abbreviation (M+) 2060.Check-if-an-Original-String-Exists-Given-Two-Encoded-Strings (H) Rolling Hash 1044.Longest-Duplicate-Substring (H) 1062.Longest-Repeatin...
Can you solve this real interview question? Two Sum - Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may n
若给出一个固定的array构成 SegmentTree,那估计很简单:按照index从0~array.lengh,leaf上就是[0,0] with value = x. 若题目让构造一个空心SegmentTree, based on value 0 ~ n-1 (n <= 10000), 然后把一个Array的value modify 进去。 这样八成是另外一种咯。 58.Count Primes.javaLevel: Easy 什么是p...
Leetcode Problems Conclusion What is hashing? Imagine you have a huge box full of books and want to find a book when you need it quickly. You could throw all your books in there randomly, but it would take a long time to find the one you want later on. That’s not very ef...
This page summarize the solutions of all problems. For thoughts,ideas written in English, refer to deach individual solution. New problems will be automatically updated once added. 0.A+B.javaLevel: Easy ^ 是不完全加法. 每次都忽略了进位。而 & 刚好可以算出需要的所有进位。
Java Algorithm Problems Leetcode#ProblemLevelTagsTimeSpaceLanguageSequence N/A Jump Game II.java Hard [Array, Coordinate DP, DP, Greedy] O(n) O(1) Java 0 N/A Majority Number II.java Medium [Enumeration, Greedy] Java 1 N/A Search a 2D Matrix II.java Medium [Binary Search, Divide and...
002 | 目录 Java Algorithm Problems Leetcode#ProblemLevelTagsTimeSpaceLanguageSequence N/A Jump Game II.java Hard [Array, Coordinate DP, DP, Greedy] O(n) O(1) Java 0 N/A Majority Number II.java Medium [Enumeration, Greedy] Java 1 N/A Search a 2D Matrix II.java Medium [Binary Search...
TwoSumII.java backtracking binary_search bit_manipulation breadth_first_search depth_first_search design divide_and_conquer dynamic_programming greedy hashing heap linked_list math stack string tree two_pointers README.mdBreadcrumbs leetcode-1 /problems /src /array / MergeIntervals.java Latest commit ...
recursive based on the condition that C(n, k) = C(n-1, k) + C(n-1, k-1) DP: DP(i, j) stores the combinations from i to j. iterative: add on to existing set one number by one number combination sum: (1) recusive: backtracking (2) DP (3) using the combination iteration...