Skip to content

ioesandeep/leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 

Repository files navigation

Leetcode problems - JAVA solution

The problems are distributed into three packages based on their difficulty level, namely; easy, medium and hard. I have tried to keep the file names as close to the title as possible.

EASY

Title Solution
1. Two Sum java
7. Reverse Integer java
13. Roman to Integer java
14. Longest Common Prefix java
20. Valid Parentheses java
21. Merge Two Sorted Lists java
28. Implement strStr() java
53. Maximum Subarray java
58. Length of Last Word java
66. Plus One java
67. Add Binary java
70. Climbing Stairs java
83. Remove Duplicates from Sorted List java
88. Merge Sorted Array java
100. Same Tree java
101. Symmetric Tree java
104. Maximum Depth of Binary Tree java
107. Binary Tree Level Order Traversal II java
108. Convert Sorted Array to Binary Search Tree java
110. Balanced Binary Tree java
111. Minimum Depth of Binary Tree java
112. Path Sum java
121. Best Time to Buy and Sell Stock java
122. Best Time to Buy and Sell Stock II java
125. Valid Palindrome java
136. Single Number java
141. Linked List Cycle java
155. Min Stack java
160. Intersection of Two Linked Lists java
167. Two Sum II - Input array is sorted java
169. Majority Element java
198. House Robber java
202. Happy Number java
203. Remove Linked List Elements java
206. Reverse Linked List java
217. Contains Duplicate java
219. Contains Duplicate II java
226. Invert Binary Tree java
231. Power of Two java
232. Implement Queue using Stacks java
234. Palindrome Linked List java
235. Lowest Common Ancestor of a Binary Search Tree java
237. Delete Node in a Linked List java
242. Valid Anagram java
252. Meeting Rooms java
257. Binary Tree Paths java
258. Add Digits java
268. Missing Number java
270. Closest Binary Search Tree Value java
283. Move Zeroes java
303. Range Sum Query - Immutable java
344. Reverse String java
345. Reverse Vowels of a String java
346. Moving Average from Data Stream java
374. Guess Number Higher or Lower java
387. First Unique Character in a String java
404. Sum of Left Leaves java
412. Fizz Buzz java
426. Convert Binary Search Tree to Sorted Doubly Linked List java
429. N-ary Tree Level Order Traversal java
434. Number of Segments in a String java
437. Path Sum III java
438. Find All Anagrams in a String java
441. Arranging Coins java
442. Find All Duplicates in an Array java
445. Add Two Numbers II java
448. Find All Numbers Disappeared in an Array java
449. Serialize and Deserialize BST java
450. Delete Node in a BST java
451. Sort Characters By Frequency java
452. Minimum Number of Arrows to Burst Balloons java
459. Repeated Substring Pattern java
482. License Key Formatting java
501. Find Mode in Binary Search Tree java
508. Most Frequent Subtree Sum java
509. Fibonacci Number java
510. Inorder Successor in BST II java
513. Find Bottom Left Tree Value java
520. Detect Capital java
530. Minimum Absolute Difference in BST java
536. Construct Binary Tree from String java
538. Convert BST to Greater Tree java
543. Diameter of Binary Tree java
551. Student Attendance Record I java
559. Maximum Depth of N-ary Tree java
560. Subarray Sum Equals K java
567. Permutation in String java
572. Subtree of Another Tree java
588. Design In-Memory File System java
589. N-ary Tree Preorder Traversal java
590. N-ary Tree Postorder Traversal java
605. Can Place Flowers java
606. Construct String from Binary Tree java
617. Merge Two Binary Trees java
637. Average of Levels in Binary Tree java
645. Set Mismatch java
653. Two Sum IV - Input is a BST java
657. Robot Return to Origin java
658. Find K Closest Elements java
669. Trim a Binary Search Tree java
671. Second Minimum Node In a Binary Tree java
675. Cut Off Trees for Golf Event java
676. Implement Magic Dictionary java
680. Valid Palindrome II java
690. Employee Importance java
692. Top K Frequent Words java
694. Number of Distinct Islands java
700. Search in a Binary Search Tree java
701. Insert into a Binary Search Tree java
705. Design HashSet java
709. To Lower Case java
719. Find K-th Smallest Pair Distance java
733. Flood Fill java
735. Asteroid Collision java
746. Min Cost Climbing Stairs java
759. Employee Free Time java
776. Split BST java
783. Minimum Distance Between BST Nodes java
811. Subdomain Visit Count java
814. Binary Tree Pruning java
819. Most Common Word java
863. All Nodes Distance K in Binary Tree java
872. Leaf-Similar Trees java
876. Middle of the Linked List java
896. Monotonic Array java
897. Increasing Order Search Tree java
904. Fruit Into Baskets java
929. Unique Email Addresses java
937. Reorder Data in Log Files java
938. Range Sum of BST java
957. Prison Cells After N Days java
958. Check Completeness of a Binary Tree java
965. Univalued Binary Tree java
973. K Closest Points to Origin java
980. Unique Paths III java
986. Interval List Intersections java
987. Vertical Order Traversal of a Binary Tree java
988. Smallest String Starting From Leaf java
1015. Smallest Integer Divisible by K java
1020. Number of Enclaves java
1022. Sum of Root To Leaf Binary Numbers java
1026. Maximum Difference Between Node and Ancestor java
1028. Recover a Tree From Preorder Traversal java
1037. Valid Boomerang java
1038. Binary Search Tree to Greater Sum Tree java
1047. Remove All Adjacent Duplicates In String java
1064. Fixed Point java
1085. Sum of Digits in the Minimum Number java
1086. High Five java
1099. Two Sum Less Than K java
1100. Find K-Length Substrings With No Repeated Characters java
1108. Defanging an IP Address java
1119. Remove Vowels from a String java
1123. Lowest Common Ancestor of Deepest Leaves java
1134. Armstrong Number java
1137. N-th Tribonacci Number java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java
java