The aim of CoderChef Kitchen is to be a one-stop shop for programmers, both experienced and amateurs alike to brush up and hone their programming skills. The repository contains well documented mini-blogs for a vast variety of programming problems.
- 🔥 Programming problems from some of the best online judges like Leetcode.com, Codechef.com etc.
- 🎉 Each problem has an intuition section, followed by the algorithm and the pseudo-code, and finally the implementation. Additionally, the problems are embellished with explanatory images and animations to provide clarity of thought.
- ✏️ For now, we only add solutions in Python for the questions. Contributions are always welcome for solutions in other programming languages.
When people start off with their programming journey, they usually come across algorithms like Linear Search, Bubble Sort, Insertion Sort and much more. There are a bazillion resources out there for such introductory algorithms.
Our aim with CoderChef Kitchen (Don't miss that 'r' 😅) is not to add articles just for the sake of it. Our main intention is to add articles that bring across some important programming concepts or some new algorithmic techniques or some interesting implementation ideas that we don't generally find online.
In addition to this, we want to make programming fun for people out there. We want to break away from the common notion of "tech articles are boring and serious". They can be pretty fun and addictive to read, if projected in a certain way.
There are multiple ways in which you can contribute. There are no "prerequisites" as such for you to become a contributor. Essentially, you can do either of the following:
-
Pick up one of the existing problems from the repository and add a solution in a language not already present in the repo. For e.g. a lot of problems currently only have solutions in Python. It would be great to have solutions in other common languages like Java or C/C++.
An important thing to consider here is that the solution you provide must be in line with the algorithm(s) already explained in the article. In case you are writing a new algorithm which has not been explained already, then make sure to add relevant explanation to the article as well.
-
The second way for you to contribute is by picking a problem which is not already there in the repository and contribute solution(s) and an article for it.
A picture is worth a thousand words
That is our motto. The articles that we write tend to be full of illustrations in the form of explanatory diagrams and gifs/videos/animations. Anything that helps explain the algorithm better. We would love future articles to be along the same lines as well. For a detailed set of guidelines for contributing a new article, read the instructions below.
-
The first thing you should do is, convey what you want to contribute. To make it a very streamlined process, create an issue in the repository describing the problem you want to pick. Also, in 1-2 lines explain why you think this problem should be added to the repo.
Kindly note this step is only to be sure that your efforts won't go to waste. Once the issue is approved, you can go ahead with article. This still doesn't guarantee that your article would be accepted on the first go. Our only suggestion is stick to the template (read below) and be as creative as possible. We are always there to help and learn in the process.
-
Clone the repo using the command
git clone https://github.com/DivyaGodayal/CoderChef-Kitchen.git
-
For every new problem, create a separate folder in the respective section. For e.g. if you are solving a problem on LeetCode related to Dynamic Programming, create a folder for the problem under the Dynamic Programming folder.
mkdir Dynamic-Programming/<Problem Name>
-
The newly created folder must contain a
README.md
file andsolution.py
file. If there are multiple solutions, you can name the solutions accordingly. e.g.solution_min_heap.py
orsolution_recursive.py
.touch README.md touch solution.py
For writing the README.md file, follow the template provided here.
Ideally, every approach to a programming problem should have the following sections:
- Motivation.
- Algorithm.
- Implementation Details. (Optional)
- Complexity Analysis.
Once you are done writing the article and the solutions, remember to add the problem to the table on the main README page. (Look at the table of contents below).
Once all your changes are done, create a local commit.
git add . git commit -am "Added article and solution for <Problem-Name>"
Push your changes to a separate branch for the problem. This new branch should be deleted once the PR is merged.
git push origin master:<branch_name>
Raise a Pull Request. This step is very important. For any changes you want to make to the repository, you have to raise a pull request. For further reading on how to raise a PR, read this.
In case of any doubt in the above steps, reach out to us. :)
Problem Platform Link 1 Daily Temperatues LeetCode Link 2 Fake Binary Search CodeChef Link 3 Fizz Buzz LeetCode Link 4 Hand of Straights LeetCode Link 5 Implement Magic Dictionary LeetCode Link 6 Integer to English-Words LeetCode Link 7 Lemonade Change LeetCode Link 8 Minimum in Rotated Sorted Array LeetCode Link 9 Minimum Refueling Stops LeetCode Link 10 Score After Flipping Matrix LeetCode Link 11 Score of Parentheses LeetCode Link 12 Set Matrix Zeros LeetCode Link 13 Spiral Matrix LeetCode Link 14 Split Array into Fibonacci Sequence LeetCode Link 15 Task Scheduler LeetCode Link 16 2 Sum LeetCode Link 17 3 Sum LeetCode Link 18 4 Sum LeetCode Link 19 Advantage Shuffle LeetCode Link 20 Next Greater Element I LeetCode Link 21 Next Greater Element II LeetCode Link 22 Rotate Array LeetCode Link 23 Maximum Product of Word Lengths LeetCode Link 24 Asteroid Collision LeetCode Link 25 Generate Parantheses LeetCode Link 26 Top K Frequent Words LeetCode Link 1 2-Keys LeetCode Link 2 4-Keys LeetCode Link 3 Change the Signs CodeChef Link 4 Matchsticks to Square LeetCode Link 5 Soup Servings LeetCode Link 6 Optimal Division LeetCode Link 7 Largest Sum of Averages LeetCode Link 8 Climbing Stairs LeetCode Link 9 Video Stitching LeetCode Link 1 All Nodes Distance K in Binary Tree LeetCode Link 2 Bus Routes LeetCode Link 3 Cheapest Flight Within K Stops LeetCode Link 4 Cracking the Safe LeetCode Link 5 Evaluate Division LeetCode Link 6 Flatten Binary Tree LeetCode Link 7 Making A Large Island LeetCode Link 8 Path Sum LeetCode Link 9 Remove Invalid Parenthesis LeetCode Link 10 Sum of Distances In a Tree LeetCode Link 11 Word Search LeetCode Link 12 Number of Islands LeetCode Link 13 Largest-Value in Each Tree Row LeetCode Link 14 Construct a Binary Tree from in-order and Postorder Traversal LeetCode Link 15 Add One Row to Tree LeetCode Link 1 DeepCopy LeetCode Link 2 Remove Nth Node from End of List LeetCode Link 3 Remove Duplicates from Sorted List I LeetCode Link 4 Remove Duplicates from Sorted List II LeetCode Link 5 Sort List LeetCode Link 6 Swap Nodes in Pairs LeetCode Link 7 Linked List Components LeetCode Link 1 Isomorphic Strings LeetCode Link 2 Minimum Window Substring LeetCode Link 3 Partition Labels LeetCode Link 4 Reorganize String LeetCode Link coderchef-kitchen's People
Forkers
edorado93 mervinred madhavrathi raghvendra1218 laxmanlax samhitharamaprasad mahak barroque preeti-taneja rasokan sidharthbansal chavamahesh ruchika1706 vishal182 paduh sumitpathak92 kamleshsahu aditya0025 gudivadaashok vipultanwar96 tanyatukade swapniljavanjal mlymolina phadated jigyasak05 arihant1467 anarquias va1demar ahmedraafat14 sunil-lulla yugander-krishan-singh ankitchachada maverickmiles lavanganji serj1408 rajibmitra waledsaleh akash1507 chaitanyaphalak sunn-e sahilchug subhahu123 arquiteturajoel savadev doc22940 satheeshks10 chetanbommu gourab-sinha ruchika8 eonkid neeraj11789 ramsailesh dukemanh cybertron1609 prabz frk008 drishti95 ramch22 vsanku01 kaushiktalukdar lakhassane drigax yash-max ashu-coder98 iraghavr luisa13 yashpj crashcumber shubhangi2202 drigger91 abhishashah sahuankit010 python-repository-hub cwaltz xonepiecex sakti2022 manojkumarpatnaik antonillecoderchef-kitchen's Issues
Minimum cost to hire K workers 😉
https://leetcode.com/problems/minimum-cost-to-hire-k-workers/description/
-
README.md
-
Solution Greedy
-
Solution Heap based
Is javascript acceptable?
A lot of programmers already working as frontend developers or some starting their journey in javascript, and struggle to practice ds/algorithms for interview preparation.
Can I submit problems/solutions in js?
Remove Dups from Sorted List-II
Minimum Number of Refueling Stops
https://leetcode.com/problems/minimum-number-of-refueling-stops/description/
-
README
-
Heap Solution
-
Dynamic Programming Solution
Lemonade Change
https://leetcode.com/problems/lemonade-change/description/
-
README
-
Solution
2Sum
https://leetcode.com/problems/two-sum/
-
README.md
-
Solution(s)
Asteroid Collision
https://leetcode.com/problems/asteroid-collision/
-
README
-
Solution(s)
Prime Palindrome
https://leetcode.com/problems/prime-palindrome/description/
-
README
-
Solution
Construct Binary Tree from Inorder and Postorder
Contruct Tree from Inorder Traversal and Postorder Traversal
This might be a tricky interview question where you are asked to generate preorder traversal from given inorder and postorder traversals.
All nodes at K distance Binary Tree
-
README
-
Solution
Generate Parentheses
Generate Parentheses
This question will help students about how to draw and solve problems using recursion tree whenever they encounter such permutations based questions
Next Largest Element - I
https://leetcode.com/problems/next-greater-element-i/description/
-
README
-
Solution(s)
Optimal Division
https://leetcode.com/problems/optimal-division/description/
-
README
-
Dynamic Programming based approach
-
Mathematical approach
Convert Sorted List to Binary Search Tree
Convert a sorted list into a binary search tree
Leet Code Question: 109This requires double pointers in c++ to accomplish the task in a faster way.
Add and Search Word Data Structure design
Find Minimum in rotated sorted array
-
README
-
Solution for the minimum as well as the maximum element
-
Explore descending order array as well.
Soup Servings
https://leetcode.com/problems/soup-servings/description/
-
README
-
Solution
Word Search
https://leetcode.com/problems/word-search/description/
-
README
-
Solution
Next Largest Element - II
-
https://leetcode.com/problems/next-greater-element-ii/description/
-
README
-
Solution(s)
Matchsticks to Square
https://leetcode.com/problems/matchsticks-to-square/description/
-
README
-
DFS Solution
-
DP based Solution
Maximum Product of Word Lengths
https://leetcode.com/problems/maximum-product-of-word-lengths/description/
-
README
-
Solution(s)
Continuous Subarray Sum
Leet Code Question No :503
continuous-subarray-sumThree ways to do:
- O(n^3) : Naive way
- O(n^2) : using dp
- O(n): using hashmap
I encountered this in my recent interview.
3Sum
https://leetcode.com/problems/3sum/
-
README.md
-
Solution(s)
Remove Invalid Parenthesis to Github.
https://leetcode.com/problems/remove-invalid-parentheses/description/
-
README
-
Solution-1 Super slow, recursive
-
Pruned recursion.
Isomorphic Strings
https://leetcode.com/problems/isomorphic-strings/description/
-
README
-
Solution
Largest Sum of Averages
Implement Magic Dictionary
https://leetcode.com/problems/implement-magic-dictionary/description/
-
README
-
Neighbors solution
-
Hash based solution
Advantage Shuffle
https://leetcode.com/problems/advantage-shuffle/description/
-
README
-
Solution(s)
4Sum
https://leetcode.com/problems/4sum/description/
-
README.md
-
Solution(s)
Score of Parenthesis
https://leetcode.com/problems/score-of-parentheses/description/
-
README
-
Solution
Top K Frequent Words
https://leetcode.com/problems/top-k-frequent-words/description/
-
README
-
Solution(s)
Remove Dups from Sorted List-I
Path Sum (Cracking the Coding Interview, Trees Chapter)
Daily Temperatures
https://leetcode.com/problems/daily-temperatures/description/
-
README
-
Heap Solution (going forward)
-
Stack solution (going reverse)
Swap Nodes in Pairs
https://leetcode.com/problems/swap-nodes-in-pairs/description/
-
README
-
Solution
Bus Routes
https://leetcode.com/problems/bus-routes/description/
-
Solution
-
README
Rotate Array
https://leetcode.com/problems/rotate-array/
There are various straightforward ways to solve this problem but while I came across quite a creative approach to solve it in O(1) extra space and O(n) time. The solution involves reversal of an array, which is shared in an article as one of the top 25 interview questions. Let me know what you think of it.
Remove Nth Node from End of List
https://leetcode.com/problems/remove-nth-node-from-end-of-list/description/
-
README
-
Solution(s)
Number of Islands
https://leetcode.com/problems/number-of-islands/description/
-
README
-
Solution(s)
Score after Flipping Matrix
-
README
-
Solution
Sort List
https://leetcode.com/problems/sort-list/description/
-
README
-
Solution(s)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.