Codegenio Interview Question

Detect patterns in arrays and design algorithm to sort them accordingly.