https://github.com/akashmodak97/competitive-coding-and-interview-problems
This repo contains some problem solutions from different popular coding platforms like Code Chef, Leet Code, Hacker Blocks,etc.
https://github.com/akashmodak97/competitive-coding-and-interview-problems
backtracking-algorithm codechef codechef-solutions competitive-coding competitive-programming cplusplus cplusplus-11 hackerblocks hackerrank hackerrank-solutions interview-practice interview-prep interview-preparation interview-questions interviewbit interviewbit-solutions leetcode-cpp leetcode-solutions programming spoj-solutions
Last synced: 11 days ago
JSON representation
This repo contains some problem solutions from different popular coding platforms like Code Chef, Leet Code, Hacker Blocks,etc.
- Host: GitHub
- URL: https://github.com/akashmodak97/competitive-coding-and-interview-problems
- Owner: akashmodak97
- License: mit
- Created: 2020-01-10T19:51:27.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-06-20T06:03:34.000Z (almost 2 years ago)
- Last Synced: 2025-04-10T01:06:05.966Z (11 days ago)
- Topics: backtracking-algorithm, codechef, codechef-solutions, competitive-coding, competitive-programming, cplusplus, cplusplus-11, hackerblocks, hackerrank, hackerrank-solutions, interview-practice, interview-prep, interview-preparation, interview-questions, interviewbit, interviewbit-solutions, leetcode-cpp, leetcode-solutions, programming, spoj-solutions
- Language: C++
- Homepage:
- Size: 1.13 MB
- Stars: 65
- Watchers: 1
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Competitive-Coding-and-Interview-Problems
This repo contains some problems from different popular coding platforms like Code Chef, Leet Code, Hacker Blocks, Interview Bit and Hackerrank. If you like this repo, then don't forget to put a star ✰
![]()
# Leet Code
1. Maximum Sub Array
2. Maximum Sum Circular Sub Array
3. Merge Sorted array
4. Pallindrome Number
5. Reverse Integer
6. Trapping rain Water
7. Two Sum
8. Rotate Image
9. Roman To Integer
10. Search Insert Position
11. Spiral Matrix
12. Spiral Matrix II
13. Longest Substring Without Repeating Characters
14. Add Two Numbers
15. Longest Common Prefix
16. Container With Most Water
17. 3Sum
18. Plus One
19. Remove Duplicates From Sorted Array
20. Remove Element
21. Move Zeroes
22. Binary Tree Level Order Traversal II
23. Prison Cells After N Days
24. Ugly Number II
25. Hamming Distance
26. Island Perimeter
27. Maximum Width Of Binary Tree
28. Flatten a Multilevel Doubly Linked List
29. Subsets
30. Reverse Bits
31. Same Tree
32. Angle Between Hands of a Clock
33. Reverse Words In A String
34. Pow(x,n)
35. Top K Frequent Elements
36. Course Schedule II
37. Add Binary
38. Remove Linked List Elements
39. Words Search
40. Binary Tree Zigzag Level Order Traversal
41. Single Number III
42. All Paths From Source to Target
43. Find Minimum In Rotated Sorted Array
44. Find Minimum In Rotated Sorted Array II
45. Single Number
46. Add Digits
47. Construct Binary Tree from Inorder and Postorder Traversal
48. Best Time to Buy and Sell Stock with Cooldown
49. Word Break II
50. Climbing Stairs
51. Detect Capital
52. Design Hashset
53. Power Of Four
54. Find All Duplicates in an Array
55. Path Sum III
56. Excel Sheet Column Number
57. Iterator for Combination
58. Longest Palindrome
59. Sort Array By Parity
60. Find The Duplicate Number
61. Missing Number
62. Remove Duplicates From A Sorted Array
63. Fizz Buzz
64. Rotate Array
65. Contains Duplicate
66. Move Zeroes
67. Delete Node From BST
68. All Elements in Two Binary Search Trees
69. Valid Parentheses
70. Valid Anagrams
71. Reverse String
72. First Unique Character in a String
73. Find First and Last Position of Element in Sorted Array
74. Binary Search Tree Iterator
75. Binary Tree Inorder Traversal
76. Binary Tree Level Order Traversal
77. N-ary Tree Level Order Traversal
78. N-ary Tree Preorder Traversal
79. Binary Tree Preorder Traversal
80. N-ary Tree Postorder Traversal
81. Binary Tree Postorder Traversal
82. Implement Queue using Stacks
83. Implement Stack using Queues
84. Remove Nth Node From End of List
85. Convert Sorted Array to Binary Search Tree
86. Insert Interval
87. Minimum Window Substring
88. Minimum Size Subarray Sum
89. Sliding Window Maximum
90. Permutation in String
91. Find All Anagrams in a String
92. Unique Paths
93. Unique Paths II
94. Minimum Path Sum
95. Maximum Depth of Binary Tree
96. Remove Duplicates from Sorted Array II
97. Invert Binary Tree
98. Longest Increasing Subsequence
99. Product of Array Except Self
100. Best Time to Buy and Sell Stock
101. Merge k Sorted Lists
102. Merge 2 Sorted Lists
103. Longest Repeating Character Replacement
104. Max Consecutive Ones III
105. Maximum Non Negative Product in a Matrix
106. Number of Good Ways to Split a String
107. Generate Parentheses
108. Letter Combinations of a Phone Number
109. Combination Sum
110. Reverse Nodes in k-Group
111. Swap Nodes in Pairs
112. Reverse Linked List
113. Recover Binary Search Tree
114. Count Good Nodes in Binary Tree
115. Binary Tree Right Side View
116. Construct Binary Tree from Preorder and Inorder Traversal
117. Element Appearing More Than 25% In Sorted Array
118. Counting Bits
119. Search in Rotated Sorted Array
120. Number of Recent Calls
121. Kth Smallest Element in a BST
122. Valid Palindrome
123. Insert into a Binary Search Tree
124. Linked List Cycle
125. Linked List Cycle II
126. Odd Even Linked List
127. Number of 1 Bits
128. Power of Two
129. Bitwise AND of Numbers Range
130. Convert Binary Number in a Linked List to Integer
131. Add Two Numbers II
132. Implement strStr()
133. Subarray Sum Equals K
134. Subarray Product Less Than K
135. Summary Ranges
136. Count Primes
137. Happy Number
138. Contains Duplicate II
139. Isomorphic Strings
140. Word Pattern
141. Length of Last Word
142. Majority Element
143. Majority Element II
144. Two Sum II - Input array is sorted
145. Find Peak Element
146. Gray Code
147. First Missing Positive
148. Remove Duplicates from Sorted List
149. Remove Duplicates from Sorted List II
150. Concatenation of Array
151. Sum of All Odd Length Subarrays
152. Set Matrix Zeroes
153. Delete Node in a Linked List
154. Kth Largest Element in an Array
155. Longest Mountain in Array
156. Valid Mountain Array
157. Split Linked List in Parts
158. Rotate List
159. Maximum Number of Balloons
160. [Maximum Absolute Sum of Any Subarray](https://leetcode.com/problems/maximum-absolute-sum-of-any-subarray)
161. [Sort Characters By Frequency](https://leetcode.com/problems/sort-characters-by-frequency)
162. [Ransom Note](https://leetcode.com/problems/ransom-note)
163. [Balanced Binary Tree](https://leetcode.com/problems/balanced-binary-tree)
164. [Populating Next Right Pointers in Each Node](https://leetcode.com/problems/populating-next-right-pointers-in-each-node)
165. [Validate Binary Search Tree](https://leetcode.com/problems/validate-binary-search-tree/)
166. [Top K Frequent Words](https://leetcode.com/problems/top-k-frequent-words/)
167. [Sender With Largest Word Count](https://leetcode.com/problems/sender-with-largest-word-count/)
168. [DI String Match](https://leetcode.com/problems/di-string-match/)
169. [Left and Right Sum Differences](https://leetcode.com/problems/left-and-right-sum-differences/)
170. [Maximum Value of a String in an Array](https://leetcode.com/problems/maximum-value-of-a-string-in-an-array/)
171. [Maximum Number of Words You Can Type](https://leetcode.com/problems/maximum-number-of-words-you-can-type/)
172. [Largest Local Values in a Matrix](https://leetcode.com/problems/largest-local-values-in-a-matrix/)
173. [Minimum Number of Operations to Move All Balls to Each Box](https://leetcode.com/problems/minimum-number-of-operations-to-move-all-balls-to-each-box/)
174. [Watering Plants](https://leetcode.com/problems/watering-plants/)
175. [Destination City](https://leetcode.com/problems/destination-city/)
176. [Count the Number of Consistent Strings](https://leetcode.com/problems/count-the-number-of-consistent-strings/)
177. [Find the Prefix Common Array of Two Arrays](https://leetcode.com/problems/find-the-prefix-common-array-of-two-arrays/)
178. [Group the People Given the Group Size They Belong To](https://leetcode.com/problems/group-the-people-given-the-group-size-they-belong-to/)
179. [Removing Stars From a String](https://leetcode.com/problems/removing-stars-from-a-string/)
180. [Build an Array With Stack Operations](https://leetcode.com/problems/build-an-array-with-stack-operations/)
181. [Validate Stack Sequences](https://leetcode.com/problems/validate-stack-sequences/)
182. [Daily Temperatures](https://leetcode.com/problems/daily-temperatures/)
183. [Minimum Remove to Make Valid Parentheses](https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses/)
184. [Substrings of Size Three with Distinct Characters](https://leetcode.com/problems/substrings-of-size-three-with-distinct-characters/)
185. [Make The String Great](https://leetcode.com/problems/make-the-string-great/)
186. [Final Prices With a Special Discount in a Shop](https://leetcode.com/problems/final-prices-with-a-special-discount-in-a-shop/)
187. [Remove All Adjacent Duplicates In String](https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string/)
188. [Remove All Adjacent Duplicates in String II](https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string-ii/)
189. [Time Needed to Buy Tickets](https://leetcode.com/problems/time-needed-to-buy-tickets/)
190. [Convert an Array Into a 2D Array With Conditions](https://leetcode.com/problems/convert-an-array-into-a-2d-array-with-conditions/)
191. [Optimal Partition of String](https://leetcode.com/problems/optimal-partition-of-string/)
192. [Find and Replace Pattern](https://leetcode.com/problems/find-and-replace-pattern/)
193. [Subdomain Visit Count](https://leetcode.com/problems/subdomain-visit-count/)
194. [Minimum Number of Arrows to Burst Balloons](https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/)
195. [Substring with Concatenation of All Words](https://leetcode.com/problems/substring-with-concatenation-of-all-words/)
196. [Is Subsequence](https://leetcode.com/problems/is-subsequence/)
197. [Longest Consecutive Sequence](https://leetcode.com/problems/longest-consecutive-sequence/)
198. [Append Characters to String to Make Subsequence](https://leetcode.com/problems/append-characters-to-string-to-make-subsequence/)
199. [Maximum Number of Vowels in a Substring of Given Length](https://leetcode.com/problems/maximum-number-of-vowels-in-a-substring-of-given-length/description/)
200. [Minimum Recolors to Get K Consecutive Black Blocks](https://leetcode.com/problems/minimum-recolors-to-get-k-consecutive-black-blocks/)
201. [Length of the Longest Alphabetical Continuous Substring](https://leetcode.com/problems/length-of-the-longest-alphabetical-continuous-substring/)
202. [Partition List](https://leetcode.com/problems/partition-list/)
203. [Maximum Twin Sum of a Linked List](https://leetcode.com/problems/maximum-twin-sum-of-a-linked-list/)
204. [Alphabet Board Path](https://leetcode.com/problems/alphabet-board-path/)
205. [Merge In Between Linked Lists](https://leetcode.com/problems/merge-in-between-linked-lists/)
206. [Valid Sudoku](https://leetcode.com/problems/valid-sudoku/)
207. [Merge Intervals](https://leetcode.com/problems/merge-intervals/)
208. [House Robber](https://leetcode.com/problems/house-robber/)
209. [Jump Game](https://leetcode.com/problems/jump-game/)
210. [Jump Game II](https://leetcode.com/problems/jump-game-ii/)
211. [Fibonacci Number](https://leetcode.com/problems/fibonacci-number/)
212. [Minimum Add to Make Parentheses Valid](https://leetcode.com/problems/minimum-add-to-make-parentheses-valid/)
213. [LRU Cache](https://leetcode.com/problems/lru-cache/)
214. [Permutations II](https://leetcode.com/problems/permutations-ii/)
215. [Find the Pivot Integer](https://leetcode.com/problems/find-the-pivot-integer/description/)
216. [Custom Sort String](https://leetcode.com/problems/custom-sort-string/)
217. [Maximum Ice Cream Bars](https://leetcode.com/problems/maximum-ice-cream-bars/)
218. [Sum In A Matrix](https://leetcode.com/problems/sum-in-a-matrix/)
219. [Maximum Sum With Exactly K Elements](https://leetcode.com/problems/maximum-sum-with-exactly-k-elements/)
220. [Arithmetic Subarrays](https://leetcode.com/problems/arithmetic-subarrays/description/)
221. [Combinations](https://leetcode.com/problems/combinations/description/)
222. [Minimum Flips to Make a OR b Equal to c](https://leetcode.com/problems/minimum-flips-to-make-a-or-b-equal-to-c/)
223. [Letter Case Permutation](https://leetcode.com/problems/letter-case-permutation/)
224. [Gas Station](https://leetcode.com/problems/gas-station/description/)
225. [N-Queens](https://leetcode.com/problems/n-queens/)
226. [N-Queens II](https://leetcode.com/problems/n-queens-ii/)
227. [Sudoku Solver](https://leetcode.com/problems/sudoku-solver/)
228. [Boats to Save People](https://leetcode.com/problems/boats-to-save-people/)
229. [The k Strongest Values in an Array](https://leetcode.com/problems/the-k-strongest-values-in-an-array)
230. [Maximum Erasure Value](https://leetcode.com/problems/maximum-erasure-value/)
231. [Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold](https://leetcode.com/problems/number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold/)
232. [Word Break](https://leetcode.com/problems/word-break/)
233. [Copy List with Random Pointer](https://leetcode.com/problems/copy-list-with-random-pointer/)# Hacker Blocks
1. Manmohan Loves Pattern - I
2. Manmohan Loves Pattern - II
3. Von Neumann Loves Binary
4. Fibonacci Pattern (Pattern 4)
5. Pattern Triangle
6. Pattern With Zeroes
7. Help Ramu
8. Decimal To Octal
9. Binary To Decimal
10. Pythagoren Triplet
11. Mountain Pattern
12. Pattern Double Sided Arrow
13. Pattern Inverted Hour Glass
14. Hollow Diamond Pattern
15. Activity Selection Problem
16. Wave Print Column Wise
17. Target Sum Pairs
18. Target Sum Triplets
19. Rain Water Harvesting
20. Maximum Subarray Sum
21. Maximum Circular Sum
22. Maximum Length Bitonic Subarray
23. Spiral Print Anticlockwise
24. Rotate Image
25. Form Biggest Number
26. Broken Calculator
27. Matrix Search
28. Sum of Two Arrays
29. Median of Sorted Arrays
30. Difference in ASCII Codes
31. Ultra Fast Mathematics
32. Max Frequency Characters
33. String Compression
34. Is Palindrome
35. Sanket And Strings
36. Can You Read This?
37. Piyush And Magical Park
38. Kth Root
39. Book Allocation Problem
40. Sorting In Linear Time
41. Aggressive Cows
42. Painter's Problem
43. Winning CB Scholarship
44. String Sort
45. Help Rahul To Search
46. Playing With Bits
47. Unique Number - I
48. XOR Profit Problem
49. Unique Number - II
50. Unique Number - III
51. Modular Exponentiation
52. Prateek Loves Candy
53. Find Last Element
54. All Indices Problem
55. Replace PI
56. Towers Of Hanoi
57. Duplicate Character Formatting
58. Remove Duplicates
59. Subsequences
60. Smart Keypad - I
61. Smart Keypad - Advanced
62. Dictionary Order (Larger)
63. Dictionary Order (Smaller)
64. Subset Sum Easy
65. Convert String To Integer
66. Keypad Codes
67. Mapped Strings
68. Sorted Array
69. Move All X At End
70. Tricky Permutations
71. Generate Parentheses
72. Count N Queen
73. Rat In A Maze
74. Sudoku Solver
75. Linked List K Append
76. Merge Sorted Linked List
77. Linked List K Reverse
78. Even After Odd LL
79. Kth Element from The Last In A LL
80. Cycle Detection And Removal In A Linked List
81. Intersection Point Of Two Linked List
82. Circular Linked List
83. Palindrome Linked List
84. Find The Greater Element
85. Prateek Sir and Coding
86. Balanced Parenthesis
87. Stock Span
88. I Am Very Busy Man
89. Redundant Parentheses
90. Queue Using Stack
91. Strongest Fighter
92. Importance Of Time
93. Build BST
94. Sum At Level K
95. Print BST keys in the Given Range
96. Tree Bottom View
97. Is Balanced Binary Tree
98. Level Order (ZigZag)
99. Create tree from Inorder and Preorder
100. Replace With Sum of Greater Nodes
101. Tree Top View
102. Tree Left View
103. Tree Right View
104. Largest BST in a Binary Tree
105. Recover BST
106. Hostel Visit
107. Merge K sorted Arrays# Interview Bit
1. Max Sum Contiguous Subarray
2. Add One To Number
3. Spiral Order Matrix II
4. Min Steps To Infinite Grid
5. Triplets With Sum Between Given Range
6. Largest Number
7. Max Non Negative Subarray
8. Longest Common Prefix# Code Chef
1. Usain Bolt vs Tiger
2. Is this a give away
3. Khaled in HIT
4. Weapon Value
5. Compress The List
6. Cache Hit
7. Chef And Demonetisation
8. Chefina And Swaps
9. Doctor Chef
10. Missing A Point
11. Ada King
12. Chef And Card Game
13. Chef And Strings
14. Even-tual Reduction
15. What Is This, a Crossover Episode
16. Chef Wars - Return of the Jedi
17. Chef and Linear Chess
18. Another Card Game Problem
19. Smallest KMP
20. Chef and Wedding Arrangements
21. Chef And Work
22. Chopsticks
23. Mode Of Frequencies
24. A Problem On Sticks
25. Ada Matrix
26. Chefina and Swap
27. Isolation Centres
28. Bowling Strategy
29. Chef and Easy Queries
30. Covid Run
31. Positive AND
32. Replace for X
33. Ada and Dishes
34. Restore Sequence
35. Iron, Magnet and Wall
36. Vaccine Production
37. Chef and Division 3
38. Encoded String
39. Maximum Production
40. Relativity
41. XxOoRr# Geeks For Geeks
1. Smallest Divisible Number
2. Addition Under Modulo
3. Digits In Factorial
4. Exactly 3 Divisors
5. Remove duplicate elements from sorted Array
6. Reverse array in groups
7. Height of Binary Tree
8. Unique Numbers
9. Delete without head pointer
10. Count Leaves in Binary Tree
11. Minimum number to form the sum even
12. Count the Zeros
13. Reverse a String
14. Sum of numbers in string
15. Red OR Green
16. Closing bracket index
17. Case-specific Sorting of Strings
18. Min Heap Implementation
19. Minimum indexed character
20. Count Leaves in Binary Tree# SPOJ
1. Aggressive Cows
2. I Am Very Busy Man
3. Biased Standings
4. Load Balancing
5. Defense Of A Kingdom
6. Transform The Expression
7. TEST - Life, the Universe, and Everything
8. The Last Digit
9. Arranging Amplifiers# Hacker Rank
1. Mini-Max Sum
2. Simple Array Sum
3. Repeated String
4. Sock Merchant
5. Counting Valley
6. Jumping On Clouds
7. Ransom Note
8. Two Strings# Contribution
Want to contribute to this repo?- The code must be written in C++
- The file must contain the Question along with the Solution (Check one file before making a pull request)
- Update README accordingly
✨ Contributors
Lets take a moment for those lovely contributors ❤️
Project Admin ❤️
Have any suggestion? Lets connect on -