Solving the 2023B Class Assignment Problem with Dynamic Programming
Given a list of children’s IDs and flags indicating whether each child shares a class with the previous one, this article explains how to determine the two class groups using a dynamic‑programming approach, presents full Python code, and analyzes its O(N + x log x + y log y) time and O(N) space complexity.
