KMP算法总结

原视频地址:【soso字幕】汪都能听懂的KMP字符串匹配算法【双语字幕】
个人觉得这个视频讲的挺棒的,这里用文字给大家简单解析一下。

目录

KMP算法基本

KMP算法实例

KMP算法核心

Next数组

具体实现代码(java)


 

KMP算法基本

kmp算法是什么? 

一种简单高效字符串匹配算法

说起字符串匹配算法,可以轻易百度到的有如下四种:

BF、KMP、BM、Sunday

BF(Brute Force)是最基本的匹配算法。如同字面意思,是一种很暴力的字符串匹配,时间复杂度O(n*m),在匹配长度很大的字符串时候效率就会很低。

为什么要了解kmp算法?

简单,容易写,关键是,面试会问啊!!!

 

KMP算法实例

这里通过一个实例,先来看看KMP是如何进行匹配的


首先设定如下:

mainStr = "aababbababc"  // 主字符串

targetStr = "ababc" // 目标字符串

下标(i)012345678910
主字符串aababbababc
目标字符串ababc      

                                                                                                  表1

 

 

第一轮匹配:

i = 0   a = a 相等

i = 1   a != b 不等于,目标字符串向后移动 1 位。

下标012345678910
主字符串aababbababc
目标字符串 ababc     

                                                                                                  表2

i = 1   a = a 相等,跳出第一轮匹配。

第二轮:

i = 2   b = b 相等

i = 3   a = a 相等

i = 4   b = b 相等

i = 5   b != c 不相等,由于前面相等的部分,"abab",构成了相同的头尾("ab" - "ab"),所以目标子串只向后移动 2 位,继续在当前位比较。

下标(i)012345678910
主字符串aababbababc
目标字符串   ababc   

                                                                                           表3

i = 5   b != a 不相等,前面相等的部分,"ab",并没有相同的头尾,所以目标子串向后移动直接跳过此部分,向后移动 2 位,继续在当前位置比较. 

下标(i)012345678910
主字符串aababbababc
目标字符串     ababc 

                                                                                           表4

i = 5   b != a 不相等,由于已经是第一位了,前面没有相等的部分,所有目标字符串向后移动 1 位,并且从 i = 6开始继续比较。

下标(i)012345678910
主字符串aababbababc
目标字符串      ababc

                                                                                           表5

i = 6   a = a相等,跳出第二轮匹配。

第三轮:

i = 7   b = b 相等

……

i = 10   c = c 相等

此时比较到了目标字符串的最后一位,比较完毕。


 

KMP算法核心

通过例子可以发现,有些时候,目标子串的移动位数,超过了 1 位,究其原因:

1:相同子串里,存在头尾相等的情况下,移动相同部分的位数。

2:相同子串里,不存在头尾相等的情况下,移动整个子串的长度(长度为0的时候移动一位)。

用图来表示可能更容易理解:

12345678910
          
          
          
  A   B     
          

黄色与绿色对齐的时候,无需一步步向后移动,下一步直接把A的位置换到B即可:

12345678910
          
          
          
     A   B  
          

规范的说法就是:移动找出最长的相同的前缀和后缀并使他们重叠。

做法明确了之后,为了方便编程,就需要KMP算法中最重要的部分,Next数组。

 

Next数组

next数组是什么?

就是储存移动位数的数组,在匹配过程中,目标字符串的第i个位置发现不同,移动后开始从第i个位置检查。

这个数组是用来辅助代码编写的。

next数组必要吗?

理论上来说是必要的,你需要知道每次移动的距离,然后确定检查位置,Next数组只是帮你存了这个位置。

你也可以不写,每次移动的时候,单独求一次距离也行ww。

这里依旧是不讲详细,只举例子:


1:前后一致型:

下标(I)012……n-3n-2n-1n
目标字符串aabxaabc
Next数组
(value)
01001230

 

2:没有重复部分:

下标(I)01234567
目标字符串abcdefgc
Next数组
(value)
00000000

 

3:有多循环:

下标(I)01234567
目标字符串abababdc
Next数组
(value)
00123400

 


 

具体实现代码(java)

如果你实在懒得了解,只想用,或者描述的不够明白,那么我在这里丢上代码:

Next数组:

int[] getNextArr(String targetStr){
        int tStrLength = targetStr.length(); // 目标字符串长度
        char[] targetStrArr = targetStr.toCharArray(); // 转换成数组
        if( targetStr == null || tStrLength <= 0 ) return null; // 不存在则返回为空
        int res[] = new int[tStrLength]; // 初始化next数组
        res[0] = 0; // 初始化第一个为0
        int i = 1;
        int j = 0; // j下标

        // 开始生成next数组
        while (i <tStrLength) { // 时间复杂度O(m),m为目标字符串长度
            if(targetStrArr[i] == targetStrArr[j]){ // i,j下标对应字符相等 则相同子串长度+1
                res[i] = 1 + j;
                j++; 
                i++;
            }else {
                if(j == 0){ // j=0的情况 此时首尾相同的子串长度为0 则开始下一位判断
                    res[i] = j;
                    i++;
                } else { // j>0
                    j = res[j - 1]; // j对应到前一个next的值 再返回开头判断是否相等 
                }
            }
        }
        return res;
    }

KMP算法:

int runKMP(String mainStr, String targetStr){
        int mStrLen = mainStr.length();
        int tStrLen = targetStr.length();
        char[] mainStrArr = mainStr.toCharArray();
        char[] targetStrArr = targetStr.toCharArray();
        if(mainStr == null || mStrLen <= 0 || mStrLen < tStrLen) return -1;
        int i = 0;
        int j = 0;
        int nextArr[] = getNextArr(targetStr); // 得到next数组 

        while (i < mStrLen){
            if(mainStrArr[i] != targetStrArr[j]){ // 不等的情况下 向后移动的位数由next数组提供 j重置为next当前值
                i +=nextArr[j];
                j = nextArr[j];
            }else { // 相等的话,同时向后移动
                i++;
                j++;
            }
            if( j == tStrLen) return i-j; // 跳出
        }
        return -1; // 没有相同的子串 返回-1
    }

最后奉上整个test程序的代码:


/**
 * @author moci
 * @create 2018-07-29 18:54
 **/
public class KMP {


    public static void main(String[] args) {
        KMP kmp = new KMP();
        kmp.runKMP();
        System.out.println();
        kmp.runBF();
    }

    void runKMP(){
        String mainStr = "";
        String mainStr0 = "qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.z";
        long startTime;
        int res;
        for (int i = 0; i <300; i++) {
            mainStr += mainStr0;
        }
        mainStr += "v";
        String targetStr = mainStr0+"v";

        System.out.println("mainStr长度: " + mainStr.length());
        System.out.println("targetStr长度: " + targetStr.length());

        startTime = System.currentTimeMillis();
        res = new KMP().runKMP(mainStr,targetStr);
        System.out.println(res);
        System.out.println("KMP方法耗时 : " +(System.currentTimeMillis()-startTime)+"ms");
    }

    void runBF(){
        String mainStr = "";
        String mainStr0 = "qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.zqwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.qwertyuiop[]asdfghjkl;zxcvbnm,.z";
        long startTime;
        int res;
        for (int i = 0; i <300; i++) {
            mainStr += mainStr0;
        }
        mainStr += "v";
        String targetStr = mainStr0+"v";

        System.out.println("mainStr长度: " + mainStr.length());
        System.out.println("targetStr长度: " + targetStr.length());

        startTime = System.currentTimeMillis();
        res = new KMP().runBF(mainStr,targetStr);
        System.out.println(res);
        System.out.println("普通方法耗时 : " +(System.currentTimeMillis()-startTime)+"ms");
    }

    int runKMP(String mainStr, String targetStr){
        int mStrLen = mainStr.length();
        int tStrLen = targetStr.length();
        char[] mainStrArr = mainStr.toCharArray();
        char[] targetStrArr = targetStr.toCharArray();
        if(mainStr == null || mStrLen <= 0 || mStrLen < tStrLen) return -1;
        int i = 0;
        int j = 0;
        int nextArr[] = getNextArr(targetStr); // 得到next数组

        while (i < mStrLen){
            if(mainStrArr[i] != targetStrArr[j]){ // 不等的情况下 向后移动的位数由next数组提供 j重置为next当前值
                i +=nextArr[j];
                j = nextArr[j];
            }else { // 相等的话,同时向后移动
                i++;
                j++;
            }
            if( j == tStrLen) return i-j; // 跳出
        }
        return -1; // 没有相同的子串 返回-1
    }
    int runBF(String mainStr, String targetStr){
        int res = 0;
        int mStrLen = mainStr.length();
        int tStrLen = targetStr.length();
        if(mainStr == null || mStrLen <= 0 || mStrLen < tStrLen) return -1;
        for (int i = 0; i < mStrLen - tStrLen+1; i++) {
            for (int j = 0; j < tStrLen; j++) {

                if(mainStr.charAt(j+i) != targetStr.charAt(j)) break;

                if(j == tStrLen-1) {
                    res = i ;
                    return res;
                }
            }
        }

        return -1;
    }

    int[] getNextArr(String targetStr){
        int tStrLength = targetStr.length(); // 目标字符串长度
        char[] targetStrArr = targetStr.toCharArray(); // 转换成数组
        if( targetStr == null || tStrLength <= 0 ) return null; // 不存在则返回为空
        int res[] = new int[tStrLength]; // 初始化next数组
        res[0] = 0; // 初始化第一个为0
        int i = 1;
        int j = 0; // j下标

        // 开始生成next数组
        while (i <tStrLength) { // 时间复杂度O(m),m为目标字符串长度
            if(targetStrArr[i] == targetStrArr[j]){ // i,j下标对应字符相等 则相同子串长度+1
                res[i] = 1 + j;
                j++;
                i++;
            }else {
                if(j == 0){ // j=0的情况 此时首尾相同的子串长度为0 则开始下一位判断
                    res[i] = j;
                    i++;
                } else { // j>0
                    j = res[j - 1]; // j对应到前一个next的值 再返回开头判断是否相等
                }
            }
        }
        return res;
    }
}

 

有什么建议,可以提出,欢迎多多交流。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值