This is my personal practice code collection for DSA and competitive programming. I saved whatever I did while learning and solving problems here.
You can clone this repository, study the code, add your own solutions, and change anything to improve it.
1100.cpp,800_900.cpp,900_1000.cpp— rating-based practice from CP31 or similar problem lists.april.cpp,june.cpp,junebooster.cpp— monthly contest/practice session files.bitmasking.cpp— bitmask DP and subset technique practice.cses.cpp— some solutions for CSES problems.digitdp.cpp— digit DP and state-based digit dynamic programming.dp.cpp— dynamic programming practice examples.graphalgos.cpp— general graph algorithm templates and solutions.graphproblem.cpp— graph problem practice and experiments.leetcode.cpp— LeetCode practice solutions.linkedlist.cpp— linked list problems and utilities.math.cpp— math and number theory practice.prefix.cpp— prefix/suffix arrays, sums, and range utilities.rerootdp.cpp— rerooting DP on trees.segment.cpp— segment tree implementations.slidingwindow.cpp— sliding window pattern solutions.sparsetable.cpp— sparse table and range min/max queries.trees.cpp— tree algorithms, traversals, and tree DP.tempCodeRunnerFile.cpp— temporary test or scratch code.hints.txt— notes and reminders for common techniques and patterns.
- Clone this repo.
- Browse the
.cppfiles and learn from the code. - Add your own problems or improve existing files.
- Compile and run each file locally.
- Study the code and learn how I solved problems.
- Add new practice files for problems you solve.
- Improve existing code with better algorithms or clearer comments.
- Rename files if you want a different organization.
The hints.txt file has quick reminders for common ideas:
prefixmin,prefixmax,suffixmin,suffixmaxprefixsum,suffixsum- Use segment tree or sparse table for range queries.
- For minimizing operations using multiply/divide, think about Dijkstra-like search or brute force.
- Try to identify independent conditions and use prefix min/max where possible.
This is my practice collection. Use it for learning, copying, or improving your own code.