reduction
sorting Arrays by decreasing pattern length