CSES-Solutions
CSES-Solutions copied to clipboard
Solutions and Editorials to all problems of CSES
CSES-Solutions
Solutions and Editorials to problems of CSES.
Current Status
Introductory Problems
- [x] - Weird Algorithm
- [x] - Missing Number
- [x] - Repetitions
- [x] - Increasing Array
- [x] - Permutations
- [x] - Number Spiral
- [x] - Two Knights
- [x] - Two Sets
- [x] - Bit Strings
- [x] - Trailing Zeros
- [x] - Coin Piles
- [x] - Palindrome Reorder
- [x] - Creating Strings I
- [x] - Apple Division
- [x] - Chessboard and Queens
- [ ] - Grid Paths
Sorting and Searching
- [ ] - Distinct Numbers
- [ ] - Apartments
- [ ] - Ferris Wheel
- [ ] - Concert Tickets
- [ ] - Restaurant Customers
- [ ] - Movie Festival
- [ ] - Sum of Two Values
- [ ] - Maximum Subarray Sum
- [ ] - Stick Lengths
- [ ] - Playlist
- [ ] - Towers
- [ ] - Traffic Lights
- [ ] - Room Allocation
- [ ] - Factory Machines
- [ ] - Tasks and Deadlines
- [ ] - Reading Books
- [ ] - Sum of Three Values
- [ ] - Sum of Four Values
- [ ] - Nearest Smaller Values
- [ ] - Subarray Sums I
- [ ] - Subarray Sums II
- [ ] - Subarray Divisibility
- [ ] - Array Division
- [ ] - Sliding Median
- [ ] - Sliding Cost
- [ ] - Movie Festival II
- [ ] - Maximum Subarray Sum II
Dynamic Programming
- [ ] - Dice Combinations
- [ ] - Minimizing Coins
- [ ] - Coin Combinations I
- [ ] - Coin Combinations II
- [ ] - Removing Digits
- [ ] - Grid Paths
- [ ] - Book Shop
- [ ] - Array Description
- [ ] - Edit Distance
- [ ] - Rectangle Cutting
- [ ] - Money Sums
- [ ] - Removal Game
- [ ] - Two Sets II
- [ ] - Increasing Subsequence
- [ ] - Projects
Graph Algorithms
- [x] - Counting Rooms
- [x] - Labyrinth
- [x] - Building Roads
- [x] - Message Route
- [ ] - Building Teams
- [ ] - Round Trip
- [x] - Monsters
- [x] - Shortest Routes I
- [x] - Shortest Routes II
- [ ] - High Score
- [ ] - Flight Discount
- [ ] - Cycle Finding
- [ ] - Flight Routes
- [x] - Round Trip II
- [x] - Course Schedule
- [ ] - Longest Flight Route
- [x] - Game Routes
- [ ] - Investigation
- [ ] - Planets Queries I
- [ ] - Planets Queries II
- [ ] - Planets Cycles
- [ ] - Road Reparation
- [ ] - Road Construction
- [ ] - Flight Routes Check
- [ ] - Planets and Kingdoms
- [ ] - Giant Pizza
- [ ] - Coin Collector
- [ ] - Mail Delivery
- [ ] - De Bruijn Sequence
- [ ] - Teleporters Path
- [ ] - Hamiltonian Flights
- [ ] - Knight's Tour
- [ ] - Download Speed
- [ ] - Police Chase
- [ ] - School Dance
- [ ] - Distinct Routes
Range Queries
- [ ] - Range Sum Queries I
- [x] - Range Minimum Queries I
- [ ] - Range Sum Queries II
- [x] - Range Minimum Queries II
- [x] - Range Xor Queries
- [ ] - Range Update Queries
- [ ] - Forest Queries
- [ ] - Hotel Queries
- [ ] - List Removals
- [ ] - Salary Queries
- [x] - Subarray Sum Queries
- [x] - Distinct Values Queries
- [ ] - Forest Queries II
- [ ] - Range Updates and Sums
- [ ] - Polynomial Queries
- [ ] - Range Queries and Copies
Tree Algorithms
- [x] - Subordinates
- [ ] - Tree Matching
- [x] - Tree Diameter
- [x] - Tree Distances I
- [ ] - Tree Distances II
- [x] - Company Queries I
- [x] - Company Queries II
- [x] - Distance Queries
- [ ] - Counting Paths
- [x] - Subtree Queries
- [x] - Path Queries
- [ ] - Distinct Colors
Mathematics
- [ ] - Exponentiation
- [ ] - Exponentiation II
- [ ] - Counting Divisors
- [ ] - Common Divisors
- [ ] - Sum of Divisors
- [ ] - Binomial Coefficients
- [ ] - Creating Strings II
- [ ] - Distributing Apples
- [ ] - Christmas Party
- [ ] - Fibonacci Numbers
- [ ] - Throwing Dice
- [ ] - Graph Paths I
- [ ] - Graph Paths II
- [ ] - Dice Probability
- [ ] - Moving Robots
- [ ] - Candy Lottery
- [ ] - Inversion Probability
- [ ] - Stick Game
- [ ] - Nim Game I
- [ ] - Nim Game II
- [ ] - Stair Game
String Algorithms
- [ ] - Word Combinations
- [ ] - String Matching
- [ ] - Finding Borders
- [ ] - Finding Periods
- [ ] - Minimal Rotation
- [ ] - Longest Palindrome
- [ ] - Required Substring
Additional Problems
- [ ] - Shortest Subsequence
- [ ] - Counting Bits
- [ ] - Swap Game
- [ ] - Meet in the Middle
- [ ] - Prüfer Code
- [ ] - Edge Directions
- [ ] - Advertisement
- [ ] - Elevator Rides
- [ ] - Maximum Xor Subarray
- [ ] - Movie Festival Queries
- [ ] - Chess Tournament
- [ ] - Tree Traversals
- [ ] - Network Renovation
- [ ] - Graph Girth
- [ ] - Intersection Points
- [ ] - String Reorder
- [ ] - Pyramid Array
- [ ] - Increasing Subsequence II
- [ ] - String Removals
- [ ] - Bit Inversions
- [ ] - Writing Numbers
- [ ] - String Transform
- [ ] - Maximum Building I
- [ ] - Sorting Methods
- [ ] - Cyclic Array
- [ ] - Food Division
- [ ] - Bit Problem
- [ ] - Swap Round Sorting
- [ ] - Tree Isomorphism I
- [ ] - Critical Cities
- [ ] - School Excursion
- [ ] - Coin Grid
- [ ] - Robot Path
- [ ] - Course Schedule II
- [ ] - Empty String
- [ ] - Grid Paths
- [ ] - Book Shop II
- [ ] - Network Breakdown
- [ ] - Visiting Cities
- [ ] - Number Grid
- [ ] - Maximum Building II
- [ ] - Stick Divisions
- [ ] - Coding Company
- [ ] - Flight Route Requests
- [ ] - Tree Isomorphism II
- [ ] - Forbidden Cities
- [ ] - Area of Rectangles
- [ ] - Creating Offices
- [ ] - Permutations II
- [ ] - New Flight Routes
Important Note
Everyone is requested to either comment their code properly or use appropriate variable and function names throughout the code.
What's this repo about?
This repo is created to house the solutions and editorials of problems of CSES at one place. CSES contains 200 problems from beginner to advanced levels.
What is CSES?
The CSES Problem Set contains a collection of competitive programming practice problems. You can access the problems here.
How to contribute?
Read the Contributing.md file for this. All the contributions should follow the guidelines.
Language for contribution
Contributions are accepted only in the following languages:
- Assembly
- C++
- Haskell
- Java
- Node.js
- Pascal
- Python2
- Python3
- Ruby
- Rust
- Scala
Learning Resources
If you are new to Open source or github. You can follow this wonderful guide to learn more about it.
Keep Learning with Open Source