function to calculate the maximum length of substring of the form R ^ nK ^ n
static int find ( String s ) { int max = 0 , i , j = 0 , countk = 0 , countr = 0 ; int [ , ] table = new int [ s . Length , 2 ] ;