1566 Detect Pattern of Length M Repeated K or More Times