Moving Stones Until Consecutive II
Sort the stones, then use a sliding window of span n for the fewest moves and the two outer gaps for the most.
Sort the stones, then use a sliding window of span n for the fewest moves and the two outer gaps for the most.