Returns true if str is k palindrome .
static bool isKPal ( String str , int k ) { String revStr = str ; revStr = reverse ( revStr ) ; int len = str . Length ; return ( isKPalRec ( str , revStr , len , len ) <= k * 2 ) ; } static String reverse ( String input ) { char [ ] temparray = input . ToCharArray ( ) ; int left , right = 0 ; right = temparray . Length - 1 ; for ( left = 0 ; left < right ; left ++ , right -- ) {