pattern on the location of adjacent swaps in order to form a horizontal or vertical same pattern more than 3, and then eliminate these patterns.