Problem 1: Tower Ascension Objective: Identify the first position in a sequence where the value exceeds the initial element. This problem requires iterating through the input list once. Store the value of the first element as a threshold. During the iteration, compare each subsequent element against...
Problem Understanding This problem simulates an operation process where m people interact with n light bulbs. Initially, all bulbs are in the ON state (represented by '1' for ON and '0' for OFF). The operations follow these rules: Person 1: Turns off all bulbs (all states become 0). Person 2: Toggle...
Consider a system with only two colors. To consolidate all balls of the first color onto the first peg, let k represent the quantity of the first color currently on the first peg. Shift the top k elements from the second peg to the third (auxiliary) peg. Sequentially move elements from the first peg...
Recovering Secret Values from Sum Permutations Given a collection of seven integers that represent a permutation of $A, B, C, A+B, B+C, A+C,$ and $A+B+C$ (with the constraint $A \le B \le C$), the objective is to isolate the original base values. Sorting the input array in ascending order immediatel...
Composite Coloring with Bounded Prime Factors Problem Specification Given a sequence of composite integers $a$ of length $n$, assign colors such that the greatest common divisor of all numbers sharing the same color exceeds $1$. The total number of distinct colors must not exceed $11$. Constraints:...