The MCP starter pack is a repository built for McMaster students interested in trying out or learning more about competitive programming. We'll include solutions and links to a variety of programming problems that we enjoyed solving at MCP and continually update this repo. For the studious few there will be interesting articles, books, or videos that we recommend reading/watching to upgrade your Algorithm and Data Structure tool belt.
Most of these problems are trivial to solve but you can use them to get familiar with new judging websites. Note: LeetCode provides users with their own I/O operations, so only functions that implement the solutions are provided.
- Designer PDF Viewer (HackerRank)
- A Pile of Stones (Codeforces)
- Caesar Cipher (HackerRank)
- Diverse Strings (CodeForces)
- Two Sum (LeetCode)
These problems are a great place to build the foundation of your algorithm and data structure skills. Most of these problems will test your knowledge on fundamental algorithms.
- BFS Breadth First Search: Shortest Reach (HackerRank)
- Roads and Libraries (HackerRank)
- N-Factorial (SPOJ)
- Fibonacci Modified (HackerRank)
- Connected Cells in a Grid (HackerRank)
- Make It Connected (CodeForces)
- Heaters (CodeForces)
- Pairs (HackerRank)
- A Time-saving Affair (HackerRank)
- Kitchen Utensils (CodeForces)
When you've got the fundamentals figured out try these problems.
- Edgy Trees (CodeForces)
- Rust & Murderer (HackerRank)
- Bear and Steady Gene (HackerRank)
- k-Tree (CodeForces)
- Graph Without Long Directed Path (CodeForces)
- Graph And Its Complement (CodeForces)
- Longest Palindromic Substring (LeetCode)
Challenging questions but very rewarding to solve.
- Union Find (geeksforgeeks) - Partition sets efficiently with this data structure.
- DFS (geeksforgeeks) - Basic graph traversing algorithm.
- BFS (geeksforgeeks) - Find the shortest path in an unweighted graph.
- Kruskal's MSP (geeksforgeeks) - Greedy algorithm for building a minimum spanning tree.
- Largest Sum Contiguous Subarray (geeksforgeeks) - Super basic DP everyone should know
- Coin Change No-Limit (geeksforgeeks) - Given a set of coins, find the number of combinations that add up a given sum.
- Longest Common Subsequence (geeksforgeeks) - Find the longest common subsequence between two words.
- Competitive Programming 3 by Felix and Steven Halim
- Competitive Programmer's Handbook by Antti Laaksonen
Competitive programming is a great way to practice for technical interviews. The problems that you solve during these contests are very similar to the types of questions you get asked during coding interviews most of the time even harder. Additionally, participating in live competitions is an amazing way to practice to remain calm and solve algorithm questions in a timed and stressful environment.
Also it's fun! :)