https://algo.monster/problems/min_adj_swaps_to_group_red_balls
Hi,
Can you explain the rationale behind the formula “reds[end_ptr] - reds[start_ptr] - end_ptr + start_ptr”?
Thanks.
Hi,
Can you explain the rationale behind the formula “reds[end_ptr] - reds[start_ptr] - end_ptr + start_ptr”?
Thanks.