Solved 299 the train swappers. cocktail sort