【leetcode_easy_array】1566. Detect Pattern of Length M Repeated K or More Times

problem

1566. Detect Pattern of Length M Repeated K or More Times

solution#1: brute search;

hint:

Use a three-layer loop to check all possible patterns by iterating through all possible
starting positions, all indexes less than m, and if the character at the index is repeated k times.

code

 

solution#2: 

code

 

参考

1. leetcode_easy_array_1566. Detect Pattern of Length M Repeated K or More Times;

2. leetcode_discussion;

posted on 2020-10-19 22:10  鹅要长大  阅读(123)  评论(0编辑  收藏  举报

导航