sorting: sort with two stacks
dynamic programming: number of paths