CodingInterview
Solutions to Leetcode, CareerCup Coding problems
Install / Use
/learn @surajr/CodingInterviewREADME
Coding Interview
Why you should follow this repository?
As a student I solved many leetcode problems but unable to identify the most efficient solution and this repo will help you with explanation and data structure wise questions. It's easy to access and time saver before the interview.
Often careercup contains buggy code and most inefficient algorithms. I try to add an effcient one with explanation in my own words.
Feel free to submit pull requests, add issues and be a contributer.
One Stop to top 100 leetcode questions
On the day before interview, don't forget to review these problems. Credit to DevkaPupara
Algorithms
- Bit Manipulation
- Arrays
- String
- HashMap
- Trees
- Dynamic-Programming
- Depth First Search
- LinkedList
- TwoPointers
- Math
- SQL
Bit Manipulation
| Website | Title | Solution | Time | Space | Difficulty | Note| |---------------- |---------------- | ----------- | --------------- | --------------- | ------------- |-----| | Careercup | Permutation Casewise | Java | O(2^n) | O(1) | Medium | | | Leetcode | 50. Pow(x, n) | Java | O(n) | O(1) | Medium | | | Leetcode | 89. Gray Code | Java | O(n) | O(1) | Medium | | | Leetcode | 137. Single Number II | Java | O(n) | O(1) | Medium | | | Leetcode | 190. Reverse Bits | Java | O(n) | O(n) | Easy | | | Leetcode | 191. Number of 1 Bits | Java | O(n) | O(1) | Easy | | | Leetcode | 260. Single Number III | Java | O(n) | O(1) | Medium | | | Leetcode | 401. Binary Watch | Java | O(n) | O(1) | Easy | | | Leetcode | 461. Hamming Distance | Java | O(n) | O(1) | Easy | | | Leetcode | 338. Counting Bits | Java | O(nk) | O(n) | Medium | |
Arrays
| Website | Title | Solution | Time | Space | Difficulty | Note| |---------------- |---------------- | ----------- | --------------- | --------------- | ------------- |-----| | Leetcode | 12. Integer to Roman | Java | O(n) | O(1) | Medium | | | Leetcode | 15. 3Sum | Java | O(n) | O(1) | Medium | | | Leetcode | 16. 3Sum Closest | Java | O(n^2) | O(1) | Medium | | | Leetcode | 26. Remove Duplicates from Sorted Array | Java | O(n) | O(1) | Easy | | | Leetcode | 27. Remove Element | Java | O(n) | O(1) | Easy | | | Leetcode | 31. Next Permutation | Java | O(n) | O(1) | Easy | | | Leetcode | 39. Combination Sum | Java | O(2^n) | O(1) | Medium | | | Leetcode | 40. Combination Sum II | Java | O(2^n) | O(1) | Medium | | | Leetcode | 46. Permutations | Java | O(2^n) | O(1) | Medium | | | Leetcode | 47. Permutations II | Java | O(2^n) | O(1) | Medium | | | Leetcode | 66. Plus One | Java | O(n) | O(1) | Easy | | | Leetcode | 78. Subsets | Java | O(2^n) | O(n) | Medium | | | Leetcode | 90. Subsets II | Java | O(2^n) | O(n) | Medium | | | Leetcode | 88. Merge Sorted Array | Java | O(n) | O(1) | Easy | | | Leetcode | 120. Triangle | Java | O(m*n) | O(1) | Medium | | | Leetcode | 121. Best Time to Buy and Sell Stock | Java | O(n) | O(1) | Easy | | | Leetcode | 189. Rotate Array | Java | O(n) | O(1) | Easy | | | Leetcode | 217. Contains Duplicate | Java | O(n) | O(1) | Easy | | | Leetcode | 228. Summary Ranges | Java | O(n) | O(1) | Medium | | | Leetcode | 268. Missing Number | Java | O(n) | O(1) | Easy | | | Leetcode | 283. Move Zeroes | Java | O(n) | O(1) | Easy | | | Leetcode | 311. Sparse Matrix Multiplication | Java | O(mnl) | O(m*l) | Medium | | | Leetcode | 350. Intersection of Two Arrays II | Java | O(m+n) | O(1) | Easy | | | Leetcode | 383. Ransom Note | Java | O(n) | O(1) | Easy | | | Leetcode | 419. Battleships in a Board | Java | O(mn) | O(1) | Medium | | | Leetcode | 442. Find All Duplicates in an Array | Java Python | O(n) | O(1) | Easy | | | Leetcode | 561. Array Partition I | Java | O(nlogn) | O(1) | Easy | | | Leetcode | 566. Reshape the Matrix | Java | O(m*n) | O(m*n) | Easy | | | Leetcode | 598. Range Addition II | Java | O(n) | O(1) | Easy | | | Leetcode | 605. Can Place Flowers | Java | O(n) | O(1) | Easy | | | Leetcode
Related Skills
node-connect
339.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
339.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.9kCommit, push, and open a PR
