3900 - 3999
Solutions categorised by Problem IDs
3942 - Minimum Operations to Sort a PermutationMinimize rotations and reversals needed to sort a permutation by checking the circular order in both directions.3946 - Maximum Number of Items From Sale IMaximize the total number of purchased and free items within a budget using dynamic programming and factor-based rewards.3947 - Maximum Number of Items From Sale IIMaximize purchased and free items within a budget using divisibility preprocessing and an efficient greedy strategy.3963 - Create Grid With Exactly One PathConstruct a grid with exactly one valid path by opening the top row and rightmost column and blocking the remaining cells.3970 - Shortest Path With At Most K Consecutive Identical CharactersFind a minimum-weight path with bounded runs of equal labels by tracking the current run length in Dijkstra's algorithm.