Skip to content

This is lintcode solution in Java with eplaination and generalization.

Notifications You must be signed in to change notification settings

venciallee/lintcode-in-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 

Repository files navigation

lintcode-in-java

This is lintcode solution in Java with eplaination and generalization.

LinkedList

# Title Solution Difficulty Source Code
35 Reverse Linked List Easy ReverseLinkedList.java
104 Merge K Sorted Lists divide and merge 2 lists Medium MergeKSortedLists.java
105 Copy List with Random Pointer map + recursive Medium CopyListwithRandomPointer.java
134 LRU Cache HashMap + linkedlist Hard LRUCache.java
165 Merge Two Sorted Lists easy loop Easy MergeTwoSortedLists.java

Tree

# Title Solution Difficulty Source Code

Array

# Title Solution Difficulty Source Code
15 Permutations backtrace Medium Permutations.java
17 Subsets backtrace Medium Subsets.java
56 Two Sum hashmap Easy TwoSum.java
57 3Sum two point Medium ThreeSum.java
58 4Sum two point Medium FourSum.java
135 Combination Sum backtrace Medium CombinationSum.java
153 Combination Sum II backtrace Medium CombinationSumII.java
389 Valid Sudoku Easy ValidSudoku.java
564 Combination Sum IV dp or recursive Medium CombinationSumIV.java
787 The Maze bfs Medium TheMaze.java
788 The Maze II dfs or bfs Medium TheMazeII.java
802 Sudoku Solver backtracking Hard SudokuSolver.java
919 Meeting Rooms II heap or treemap Medium MeetingRoomsII.java
957 Radar Detection Easy RadarDetection.java
959 K Spaced Array Sorting Medium KSpacedArraySorting.java
1301 Game of Life Medium GameofLife.java

String

# Title Solution Difficulty Source Code
32 Minimum Window Substring slide window Medium MinimumWindowSubstring.java
53 Reverse Words in a String reverse whole char, and reverse each word. Easy ReverseWordsinaString.java
120 Word Ladder bfs Hard WordLadder.java
136 Palindrome Partitioning backtrace Medium PalindromePartitioning.java
158 Valid Anagram Easy ValidAnagram.java
192 Wildcard Matching dp or dfs Hard WildcardMatching.java
213 String Compression dfs Easy StringCompression.java
639 Word Abbreviation hashmap Hard WordAbbreviation.java
640 One Edit Distance Medium OneEditDistance.java
655 Add Strings Easy AddStrings.java
656 Multiply Strings Medium MultiplyStrings.java
773 Vlid Anagram Easy VlidAnagram.java
849 Basic Calculator III stack Hard BasicCalculatorIII.java
887 Ternary Expression Parser Medium TernaryExpressionParser.java
892 Alien Dictionary topological sort Hard AlienDictionary.java
956 Data Segmentation Easy DataSegmentation.java
958 Palindrome Data Stream Easy PalindromeDataStream.java
978 Basic Calculator stack Medium BasicCalculator.java
980 Basic Calculator II stack Medium BasicCalculatorII.java
1255 Remove K Digits Medium RemoveKDigits.java

Dynamic Programming

# Title Solution Difficulty Source Code
29 Interleaving String dp Medium InterleavingString.java
76 Longest Increasing Subsequence dp Medium LongestIncreasingSubsequence.java
77 Longest Common Subsequence dp Medium LongestCommonSubsequence.java
107 Word Break dp Medium WordBreak.java
108 Palindrome Partitioning II dp Medium PalindromePartitioningII.java
109 Triangle dp Medium Triangle.java
110 Minimum Path Sum dp Easy MinimumPathSum.java
111 Climbing Stairs dp Easy ClimbingStairs.java
114 Unique Paths dp Easy UniquePaths.java
115 Unique Paths II dp Easy UniquePathsII.java
116 Jump Game dp Medium JumpGame.java
117 Jump Game II dp Medium JumpGameII.java
118 Distinct Subsequences dp Medium DistinctSubsequences.java
119 Edit Distance dp Medium EditDistance.java
163 Unique Binary Search Trees dp Medium UniqueBinarySearchTrees.java
168 Burst Balloons dp Hard BurstBalloons.java
392 House Robber dp Medium HouseRobber.java
622 Frog Jump dp or dfs Hard FrogJump.java

Stack

# Title Solution Difficulty Source Code
12 Min Stack linkedlist Medium MinStack.java
528 Flatten Nested List Iterator stack Medium FlattenNestedListIterator.java

Tree

# Title Solution Difficulty Source Code
69 Binary Tree Level Order Traversal bfs Easy BinaryTreeLevelOrderTraversal.java
70 Binary Tree Level Order Traversal II bfs Medium BinaryTreeLevelOrderTraversalII.java
95 Validate Binary Search Tree recursive Medium ValidateBinarySearchTree.java
651 Binary Tree Vertical Order Traversal bfs + hashmap Medium BinaryTreeVerticalOrderTraversal.java
900 Closest Binary Search Tree Value dfs Medium ClosestBinarySearchTreeValue.java

Design

# Title Solution Difficulty Source Code
204 Singleton ood Naive Singleton.java
456 Reference ood Naive ReferenceManager.java
560 Friendship Service ood Easy FriendshipService.java
566 GFS Client ood Medium GFSClient.java
708 ElevatorSystem ood Hard ElevatorSystem.java
748 Kindle OO Design ood Medium KindleOODesign.java

About

This is lintcode solution in Java with eplaination and generalization.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages