BFS on Parity-Based Reachability for a Single 1 in a Binary String
Spinning Around
Given a binary string (S) of length (n) with exactly one 1. In each operation, you can reverse a substring of length (k). For each position (i), find the minimum number of operations to move the 1 to position (i). Some positions are forbidden and cannot hold the 1 during the process. If no such number exists, output (-1).
(n \le ...
Posted on Fri, 15 May 2026 16:47:23 +0000 by Matt Kindig