Function aoc::year2017::day18::part2

source ยท
pub fn part2(input: &[u64]) -> usize
Expand description

Bubble sort the sequence into descending order, counting the number of passes. Starting with program 1 each program alternates sorting the input by sending it to the other program, so the number of passes that program 1 takes is the total divided by two rounding up.