Skip to content

This repo contains some problem solutions from different popular coding platforms like Code Chef, Leet Code, Hacker Blocks,etc.

License

Notifications You must be signed in to change notification settings

akashmodak97/Competitive-Coding-and-Interview-Problems

Repository files navigation

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
  161. Sort Characters By Frequency
  162. Ransom Note
  163. Balanced Binary Tree
  164. Populating Next Right Pointers in Each Node
  165. Validate Binary Search Tree
  166. Top K Frequent Words
  167. Sender With Largest Word Count
  168. DI String Match
  169. Left and Right Sum Differences
  170. Maximum Value of a String in an Array
  171. Maximum Number of Words You Can Type
  172. Largest Local Values in a Matrix
  173. Minimum Number of Operations to Move All Balls to Each Box
  174. Watering Plants
  175. Destination City
  176. Count the Number of Consistent Strings
  177. Find the Prefix Common Array of Two Arrays
  178. Group the People Given the Group Size They Belong To
  179. Removing Stars From a String
  180. Build an Array With Stack Operations
  181. Validate Stack Sequences
  182. Daily Temperatures
  183. Minimum Remove to Make Valid Parentheses
  184. Substrings of Size Three with Distinct Characters
  185. Make The String Great
  186. Final Prices With a Special Discount in a Shop
  187. Remove All Adjacent Duplicates In String
  188. Remove All Adjacent Duplicates in String II
  189. Time Needed to Buy Tickets
  190. Convert an Array Into a 2D Array With Conditions
  191. Optimal Partition of String
  192. Find and Replace Pattern
  193. Subdomain Visit Count
  194. Minimum Number of Arrows to Burst Balloons
  195. Substring with Concatenation of All Words
  196. Is Subsequence
  197. Longest Consecutive Sequence
  198. Append Characters to String to Make Subsequence
  199. Maximum Number of Vowels in a Substring of Given Length
  200. Minimum Recolors to Get K Consecutive Black Blocks
  201. Length of the Longest Alphabetical Continuous Substring
  202. Partition List
  203. Maximum Twin Sum of a Linked List
  204. Alphabet Board Path
  205. Merge In Between Linked Lists
  206. Valid Sudoku
  207. Merge Intervals
  208. House Robber
  209. Jump Game
  210. Jump Game II
  211. Fibonacci Number
  212. Minimum Add to Make Parentheses Valid
  213. LRU Cache
  214. Permutations II
  215. Find the Pivot Integer
  216. Custom Sort String
  217. Maximum Ice Cream Bars
  218. Sum In A Matrix
  219. Maximum Sum With Exactly K Elements
  220. Arithmetic Subarrays
  221. Combinations
  222. Minimum Flips to Make a OR b Equal to c
  223. Letter Case Permutation
  224. Gas Station
  225. N-Queens
  226. N-Queens II
  227. Sudoku Solver
  228. Boats to Save People
  229. The k Strongest Values in an Array
  230. Maximum Erasure Value
  231. Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold
  232. Word Break
  233. 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 -