Solve TwoWaysSorting