codeparrot/xlcost-text-to-code huggingface dataset:
Print longest palindrome word in a sentence | C # program to print longest palindrome word in a sentence and its length ; Function to check if a word is palindrome ; making the check case case insensitive ; loop to check palindrome ; Function to find longest palindrome word ; to check last word for palindrome ; to store each word ; extracting each word ; Driver code
using System ; class GFG { static bool checkPalin ( string word ) { int n = word . Length ; word = word . ToLower ( ) ; for ( int i = 0 ; i < n ; i ++ , n -- ) if ( word [ i ] != word [ n - 1 ] ) return false ; return true ; } static string longestPalin ( string str ) { str = str + " ▁ " ; string longestword = " " , word = " " ; int length , length1 = 0 ; for ( int i = 0 ; i < str . Length ; i ++ ) { char ch = str [ i ] ; if ( ch != ' ▁ ' ) word = word + ch ; else { length = word . Length ; if ( checkPalin ( word ) && length > length1 ) { length1 = length ; longestword = word ; } word = " " ; } } return longestword ; } public static void Main ( ) { string s = " My ▁ name ▁ is ▁ ava ▁ and ▁ i " + " ▁ love ▁ Geeksforgeeks " ; if ( longestPalin ( s ) == " " ) Console . Write ( " No ▁ Palindrome ▁ Word " ) ; else Console . Write ( longestPalin ( s ) ) ; } }
Number of common base strings for two strings | C # program to count common base strings of s1 and s2 . ; function for finding common divisor ; Checking if ' base ' is base String of ' s1' ; Checking if ' base ' is base String of ' s2' ; Driver code
using System ; class GFG { static bool isCommonBase ( String Base , String s1 , String s2 ) { for ( int j = 0 ; j < s1 . Length ; ++ j ) { if ( Base [ j % Base . Length ] != s1 [ j ] ) { return false ; } } for ( int j = 0 ; j < s2 . Length ; ++ j ) { if ( Base [ j % Base . Length ] != s2 [ j ] ) { return false ; } } return true ; } static int countCommonBases ( String s1 , String s2 ) { int n1 = s1 . Length , n2 = s2 . Length ; int count = 0 ; for ( int i = 1 ; i <= Math . Min ( n1 , n2 ) ; i ++ ) { String Base = s1 . Substring ( 0 , i ) ; if ( isCommonBase ( Base , s1 , s2 ) ) { count ++ ; } } return count ; } public static void Main ( ) { String s1 = " pqrspqrs " ; String s2 = " pqrspqrspqrspqrs " ; Console . Write ( countCommonBases ( s1 , s2 ) ) ; } }
Removing elements between the two zeros | C # program to delete elements between zeros ; Function to find the string after operation ; Travesing through string ; Checking for character Between two zeros ; deleting the character At specific position ; updating the length of the string ; Driver code
using System ; class GFG { static string findstring ( string s ) { int n = s . Length ; string st = " " ; for ( int i = 1 ; i < n - 1 ; i ++ ) { if ( ( s [ i - 1 ] == '0' && s [ i + 1 ] == '0' ) ) { st = s . Remove ( i , 1 ) ; s = st ; i -- ; if ( i > 0 && s [ i - 1 ] == '0' ) i -- ; n = s . Length ; } } return s ; } static void Main ( ) { Console . Write ( findstring ( "100100" ) ) ; } }
Perfect Square String | C # program to find if string is a perfect square or not . ; calculating the length of the string ; calculating the ASCII value of the string ; Find floating point value of square root of x . ; If square root is an integer ; Driver Code
using System ; class GFG { static bool isPerfectSquareString ( string str ) { int sum = 0 ; int len = str . Length ; for ( int i = 0 ; i < len ; i ++ ) sum += ( int ) str [ i ] ; double squareRoot = Math . Sqrt ( sum ) ; double F = Math . Floor ( squareRoot ) ; return ( ( squareRoot - F ) == 0 ) ; } public static void Main ( ) { string str = " d " ; if ( isPerfectSquareString ( str ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }
Count substrings with each character occurring at most k times | C # program to count number of substrings in which each character has count less than or equal to k . ; function to find number of substring in which each character has count less than or equal to k . ; initialize left and right pointer to 0 ; an array to keep track of count of each alphabet ; decrement the count ; increment left pointer ; Driver code
using System ; class GFG { static int find_sub ( string s , int k ) { int len = s . Length ; int lp = 0 , rp = 0 ; int ans = 0 ; int [ ] hash_char = new int [ 26 ] ; for ( ; rp < len ; rp ++ ) { hash_char [ s [ rp ] - ' a ' ] ++ ; while ( hash_char [ s [ rp ] - ' a ' ] > k ) { hash_char [ s [ lp ] - ' a ' ] -- ; lp ++ ; } ans += rp - lp + 1 ; } return ans ; } static public void Main ( ) { String S = " aaabb " ; int k = 2 ; Console . WriteLine ( find_sub ( S , k ) ) ; } }
Remove consecutive vowels from string | C # program for printing sentence without repetitive vowels ; function which returns True or False for occurrence of a vowel ; this compares vowel with character ' c ' ; function to print resultant string ; print 1 st character ; loop to check for each character ; comparison of consecutive characters ; Driver Code
using System ; class GFG { static bool is_vow ( char c ) { return ( c == ' a ' ) || ( c == ' e ' ) || ( c == ' i ' ) || ( c == ' o ' ) || ( c == ' u ' ) ; } static void removeVowels ( string str ) { Console . Write ( str [ 0 ] ) ; for ( int i = 1 ; i < str . Length ; i ++ ) if ( ( ! is_vow ( str [ i - 1 ] ) ) || ( ! is_vow ( str [ i ] ) ) ) Console . Write ( str [ i ] ) ; } static void Main ( ) { string str = " geeks ▁ for ▁ geeks " ; removeVowels ( str ) ; } }
Find the Number which contain the digit d | C # program to print the number which contain the digit d from 0 to n ; function to display the values ; Converting d to character ; Loop to check each digit one by one . ; initialize the string ; checking for digit ; Driver code
using System ; class GFG { static void printNumbers ( int n , int d ) { String st = " " + d ; char ch = st [ 0 ] ; for ( int i = 0 ; i < n ; i ++ ) { st = " " ; st = st + i ; if ( i == d || st . IndexOf ( ch ) >= 0 ) Console . Write ( i + " ▁ " ) ; } } public static void Main ( ) { int n = 100 , d = 5 ; printNumbers ( n , d ) ; } }
Transform a string such that it has abcd . . z as a subsequence | C # Program to transform the given string to contain the required subsequence ; function to transform string with string passed as reference ; initializing the variable ch to ' a ' ; if the length of string is less than 26 , we can 't obtain the required  subsequence ; if ch has reached ' z ' , it means we have transformed our string such that required subsequence can be obtained ; current character is not greater than ch , then replace it with ch and increment ch ; Driver Code
using System ; using System . Text ; using System . Collections . Generic ; class GFG { static bool transformString ( ref StringBuilder s ) { char ch = ' a ' ; if ( s . Length < 26 ) return false ; for ( int i = 0 ; i < s . Length ; i ++ ) { if ( ( int ) ch > 122 ) break ; if ( s [ i ] <= ch ) { s [ i ] = ch ; ch = ( char ) ( ( int ) ch + 1 ) ; } } if ( ch <= ' z ' ) return false ; return true ; } public static void Main ( ) { StringBuilder str = new StringBuilder ( " aaaaaaaaaaaaaaaaaaaaaaaaaa " ) ; if ( transformString ( ref str ) ) Console . WriteLine ( str + " STRNEWLINE " ) ; else Console . WriteLine ( " Not ▁ Possible " + " STRNEWLINE " ) ; } }
Number of pairs with Pandigital Concatenation | C # program to find all Pandigital concatenations of two strings . ; Checks if a given string is Pandigital ; digit i is not present thus not pandigital ; Returns number of pairs of strings resulting in Pandigital Concatenations ; iterate over all pair of strings ; Driver code
using System ; using System . Collections . Generic ; class GFG { static int isPanDigital ( string s ) { int [ ] digits = new int [ 10 ] ; Array . Clear ( digits , 0 , 10 ) ; for ( int i = 0 ; i < s . Length ; i ++ ) digits [ s [ i ] - ( int ) '0' ] = 1 ; for ( int i = 0 ; i <= 9 ; i ++ ) if ( digits [ i ] == 0 ) return 0 ; return 1 ; } static int countPandigitalPairs ( ref List < string > v ) { int pairs = 0 ; for ( int i = 0 ; i < v . Count ; i ++ ) for ( int j = i + 1 ; j < v . Count ; j ++ ) if ( isPanDigital ( v [ i ] + v [ j ] ) == 1 ) pairs ++ ; return pairs ; } static void Main ( ) { List < string > v = new List < string > { "123567" , "098234" , "14765" , "19804" } ; Console . WriteLine ( countPandigitalPairs ( ref v ) ) ; } }
Number of pairs with Pandigital Concatenation | C # program to count PanDigital pairs ; Stores digits present in String v [ i ] atleast once . We use a set as we only need digits which exist only once ( irrespective of reputation ) ; Calculate the mask by considering all digits existing atleast once ; Increment the frequency of this mask ; Returns number of pairs of Strings resulting in Pandigital Concatenations ; All possible Strings lie between 1 and 1023 so we iterate over every possible mask ; If the concatenation results in mask of Pandigital Concatenation , calculate all pairs formed with Masks i and j ; Since every pair is considers twice , we get rid of half of these ; Find frequencies of all masks in given vector of Strings ; Return all possiblg concatenations . ; Driver code
using System ; using System . Collections . Generic ; class GFG { static int pandigitalMask = ( ( 1 << 10 ) - 1 ) ; static void computeMaskFrequencies ( List < String > v , Dictionary < int , int > freq ) { for ( int i = 0 ; i < v . Count ; i ++ ) { int mask = 0 ; HashSet < int > digits = new HashSet < int > ( ) ; for ( int j = 0 ; j < v [ i ] . Length ; j ++ ) digits . Add ( v [ i ] [ j ] - '0' ) ; foreach ( int it in digits ) { int digit = ( it ) ; mask += ( 1 << digit ) ; } if ( freq . ContainsKey ( mask ) ) { freq [ mask ] ++ ; } else { freq . Add ( mask , 1 ) ; } } } static int pandigitalConcatenations ( Dictionary < int , int > freq ) { int ans = 0 ; for ( int i = 1 ; i <= 1023 ; i ++ ) { for ( int j = 1 ; j <= 1023 ; j ++ ) { if ( ( i j ) == pandigitalMask && freq . ContainsKey ( j ) && freq . ContainsKey ( i ) ) { if ( i == j ) ans += ( freq [ i ] * ( freq [ i ] - 1 ) ) ; else ans += ( freq [ i ] * freq [ j ] ) ; } } } return ans / 2 ; } static int countPandigitalPairs ( List < String > v ) { Dictionary < int , int > freq = new Dictionary < int , int > ( ) ; computeMaskFrequencies ( v , freq ) ; return pandigitalConcatenations ( freq ) ; } public static void Main ( String [ ] args ) { List < String > v = new List < String > ( ) ; v . Add ( "123567" ) ; v . Add ( "098234" ) ; v . Add ( "14765" ) ; v . Add ( "19804" ) ; Console . Write ( countPandigitalPairs ( v ) + " STRNEWLINE " ) ; } }
Print the arranged positions of characters to make palindrome | C # program to print original positions of characters in a String after rearranging and forming a palindrome ; Maximum number of characters ; Insert all positions of every character in the given String . ; find the number of odd elements . Takes O ( n ) ; A palindrome cannot contain more than 1 odd characters ; Print positions in first half of palindrome ; Consider one instance odd character ; Print positions in second half of palindrome ; Driver code
using System ; using System . Collections . Generic ; class GFG { static int MAX = 256 ; static void printPalindromePos ( String str ) { List < int > [ ] pos = new List < int > [ MAX ] ; for ( int i = 0 ; i < MAX ; i ++ ) pos [ i ] = new List < int > ( ) ; int n = str . Length ; for ( int i = 0 ; i < n ; i ++ ) pos [ str [ i ] ] . Add ( i + 1 ) ; int oddCount = 0 ; char oddChar = ( char ) 0 ; for ( int i = 0 ; i < MAX ; i ++ ) { if ( pos [ i ] . Count % 2 != 0 ) { oddCount ++ ; oddChar = ( char ) i ; } } if ( oddCount > 1 ) Console . Write ( " NO ▁ PALINDROME " ) ; for ( int i = 0 ; i < MAX ; i ++ ) { int mid = pos [ i ] . Count / 2 ; for ( int j = 0 ; j < mid ; j ++ ) Console . Write ( pos [ i ] [ j ] + " ▁ " ) ; } if ( oddCount > 0 ) { int last = pos [ oddChar ] . Count - 1 ; Console . Write ( pos [ oddChar ] [ last ] + " ▁ " ) ; pos [ oddChar ] . RemoveAt ( pos [ oddChar ] . Count - 1 ) ; } for ( int i = MAX - 1 ; i >= 0 ; i -- ) { int count = pos [ i ] . Count ; for ( int j = count / 2 ; j < count ; j ++ ) Console . Write ( pos [ i ] [ j ] + " ▁ " ) ; } } public static void Main ( String [ ] args ) { String s = " geeksgk " ; printPalindromePos ( s ) ; } }
Minimum changes to a string to make all substrings distinct | C # program to count number of changes to make all substrings distinct . ; Returns minimum changes to str so that no substring is repeated . ; If length is more than maximum allowed characters , we cannot get the required string . ; Variable to store count of distinct characters ; To store counts of different characters ; Answer is , n - number of distinct char ; Driver function
using System ; class GFG { static int MAX_CHAR = 26 ; public static int minChanges ( string str ) { int n = str . Length ; if ( n > MAX_CHAR ) return - 1 ; int dist_count = 0 ; int [ ] count = new int [ MAX_CHAR ] ; for ( int i = 0 ; i < MAX_CHAR ; i ++ ) count [ i ] = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( count [ str [ i ] - ' a ' ] == 0 ) dist_count ++ ; count [ str [ i ] - ' a ' ] ++ ; } return ( n - dist_count ) ; } public static void Main ( ) { string str = " aebaecedabbee " ; Console . WriteLine ( minChanges ( str ) ) ; } }
Reverse each word in a linked list node | C # program to reverse each word in a linked list ; Linked list Node ure ; Function to create newNode in a linked list ; reverse each node data ; iterate each node and call reverse_word for each node data ; printing linked list ; Driver program
using System ; class GFG { public class Node { public String c ; public Node next ; } ; static Node newNode ( String c ) { Node temp = new Node ( ) ; temp . c = c ; temp . next = null ; return temp ; } static String reverse_word ( String str ) { String s = " " ; for ( int i = 0 ; i < str . Length ; i ++ ) s = str [ i ] + s ; return s ; } static Node reverse ( Node head ) { Node ptr = head ; while ( ptr != null ) { ptr . c = reverse_word ( ptr . c ) ; ptr = ptr . next ; } return head ; } static void printList ( Node head ) { while ( head != null ) { Console . Write ( head . c + " ▁ " ) ; head = head . next ; } } public static void Main ( String [ ] args ) { Node head = newNode ( " Geeksforgeeks " ) ; head . next = newNode ( " a " ) ; head . next . next = newNode ( " computer " ) ; head . next . next . next = newNode ( " science " ) ; head . next . next . next . next = newNode ( " portal " ) ; head . next . next . next . next . next = newNode ( " for " ) ; head . next . next . next . next . next . next = newNode ( " geeks " ) ; Console . Write ( " List ▁ before ▁ reverse : ▁ STRNEWLINE " ) ; printList ( head ) ; head = reverse ( head ) ; Console . Write ( " STRNEWLINE STRNEWLINE List ▁ after ▁ reverse : ▁ STRNEWLINE " ) ; printList ( head ) ; } }
Number of strings of length N with no palindromic sub string | C # program to count number of strings of size m such that no substring is palindrome . ; Return the count of strings with no palindromic substring . ; Driver Code
using System ; class GFG { static int numofstring ( int n , int m ) { if ( n == 1 ) return m ; if ( n == 2 ) return m * ( m - 1 ) ; return m * ( m - 1 ) * ( int ) Math . Pow ( m - 2 , n - 2 ) ; } public static void Main ( ) { int n = 2 , m = 3 ; Console . Write ( numofstring ( n , m ) ) ; } }
Count special palindromes in a String | C # program to count special Palindromic substring ; Function to count special Palindromic susbstring ; store count of special Palindromic substring ; it will store the count of continues same char ; traverse string character from left to right ; store same character count ; count smiler character ; Case : 1 so total number of substring that we can generate are : K * ( K + 1 ) / 2 here K is sameCharCount ; store current same char count in sameChar [ ] array ; increment i ; Case 2 : Count all odd length Special Palindromic substring ; if current character is equal to previous one then we assign Previous same character count to current one ; case 2 : odd length ; subtract all single length substring ; Driver code
using System ; class GFG { public static int CountSpecialPalindrome ( String str ) { int n = str . Length ; int result = 0 ; int [ ] sameChar = new int [ n ] ; for ( int v = 0 ; v < n ; v ++ ) sameChar [ v ] = 0 ; int i = 0 ; while ( i < n ) { int sameCharCount = 1 ; int j = i + 1 ; while ( j < n && str [ i ] == str [ j ] ) { sameCharCount ++ ; j ++ ; } result += ( sameCharCount * ( sameCharCount + 1 ) / 2 ) ; sameChar [ i ] = sameCharCount ; i = j ; } for ( int j = 1 ; j < n ; j ++ ) { if ( str [ j ] == str [ j - 1 ] ) sameChar [ j ] = sameChar [ j - 1 ] ; if ( j > 0 && j < ( n - 1 ) && ( str [ j - 1 ] == str [ j + 1 ] && str [ j ] != str [ j - 1 ] ) ) result += Math . Min ( sameChar [ j - 1 ] , sameChar [ j + 1 ] ) ; } return result - n ; } public static void Main ( ) { String str = " abccba " ; Console . Write ( CountSpecialPalindrome ( str ) ) ; } }
Print Bracket Number | C # implementation to print the bracket number ; function to print the bracket number ; used to print the bracket number for the left bracket ; used to obtain the bracket number for the right bracket ; traverse the given expression ' exp ' ; if current character is a left bracket ; print ' left _ bnum ' , ; Push ' left _ bum ' on to the stack ' right _ bnum ' ; increment ' left _ bnum ' by 1 ; else if current character is a right bracket ; print the top element of stack ' right _ bnum ' it will be the right bracket number ; Pop the top element from the stack ; Driver Code
using System ; using System . Collections . Generic ; class GFG { static void printBracketNumber ( string exp , int n ) { int left_bnum = 1 ; Stack < int > right_bnum = new Stack < int > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( exp [ i ] == ' ( ' ) { Console . Write ( left_bnum + " ▁ " ) ; right_bnum . Push ( left_bnum ) ; left_bnum ++ ; } else if ( exp [ i ] == ' ) ' ) { Console . Write ( right_bnum . Peek ( ) + " ▁ " ) ; right_bnum . Pop ( ) ; } } } static void Main ( ) { string exp = " ( a + ( b * c ) ) + ( d / e ) " ; int n = exp . Length ; printBracketNumber ( exp , n ) ; } }
Find if a string starts and ends with another given string | C # program to find if a given corner string is present at corners . ; If length of corner string is more , it cannot be present at corners . ; Return true if corner string is present at both corners of given string . ; Driver Code
using System ; class GFG { static bool isCornerPresent ( string str , string corner ) { int n = str . Length ; int cl = corner . Length ; if ( n < cl ) return false ; return ( str . Substring ( 0 , cl ) . Equals ( corner ) && str . Substring ( n - cl , cl ) . Equals ( corner ) ) ; } static void Main ( ) { string str = " geeksforgeeks " ; string corner = " geeks " ; if ( isCornerPresent ( str , corner ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }
Find i 'th Index character in a binary string obtained after n iterations | C # Program to find ith character in a binary string . ; Function to store binary Representation ; Function to find ith character ; Function to change decimal to binary ; Assign s1 string in s string ; Driver Code
using System ; class GFG { static string ReverseString ( string s ) { char [ ] arr = s . ToCharArray ( ) ; Array . Reverse ( arr ) ; return new string ( arr ) ; } static void binary_conversion ( ref string s , int m ) { while ( m != 0 ) { int tmp = m % 2 ; s += tmp . ToString ( ) ; m = ( int ) ( m / 2 ) ; } s = ReverseString ( s ) ; } static int find_character ( int n , int m , int i ) { string s = " " ; binary_conversion ( ref s , m ) ; string s1 = " " ; for ( int x = 0 ; x < n ; x ++ ) { for ( int y = 0 ; y < s . Length ; y ++ ) { if ( s [ y ] == '1' ) s1 += "10" ; else s1 += "01" ; } s = s1 ; s1 = " " ; } return s [ i ] - '0' ; } static void Main ( ) { int m = 5 , n = 2 , i = 8 ; Console . Write ( find_character ( n , m , i ) ) ; } }
Maximum segment value after putting k breakpoints in a number | C # program to find the maximum segment value after putting k breaks . ; Function to Find Maximum Number ; Maximum segment length ; Find value of first segment of seg_len ; Find value of remaining segments using sliding window ; To find value of current segment , first remove leading digit from previous value ; Then add trailing digit ; Driver code
using System ; class GFG { static int findMaxSegment ( string s , int k ) { int seg_len = s . Length - k ; int res = 0 ; for ( int i = 0 ; i < seg_len ; i ++ ) res = res * 10 + ( s [ i ] - '0' ) ; int seg_len_pow = ( int ) Math . Pow ( 10 , seg_len - 1 ) ; int curr_val = res ; for ( int i = 1 ; i <= ( s . Length - seg_len ) ; i ++ ) { curr_val = curr_val - ( s [ i - 1 ] - '0' ) * seg_len_pow ; curr_val = curr_val * 10 + ( s [ i + seg_len - 1 ] - '0' ) ; res = Math . Max ( res , curr_val ) ; } return res ; } public static void Main ( ) { String s = "8754" ; int k = 2 ; Console . WriteLine ( " Maximum ▁ number ▁ = ▁ " + findMaxSegment ( s , k ) ) ; } }
Consecutive sequenced numbers in a string | C # Program to check whether a String contains consecutive sequential numbers or not ; function to check consecutive sequential number ; variable to store starting number ; length of the input String ; find the number till half of the String ; new String containing the starting substring of input String ; converting starting substring into number ; backing up the starting number in start ; while loop until the new_String is smaller than input String ; next number ; concatenate the next number ; check if new String becomes equal to input String ; if String doesn 't contains consecutive numbers ; Driver Code
using System ; class GFG { static int isConsecutive ( String str ) { int start ; int length = str . Length ; for ( int i = 0 ; i < length / 2 ; i ++ ) { String new_str = str . Substring ( 0 , i + 1 ) ; int num = int . Parse ( new_str ) ; start = num ; while ( new_str . Length < length ) { num ++ ; new_str = new_str + String . Join ( " " , num ) ; } if ( new_str . Equals ( str ) ) return start ; } return - 1 ; } public static void Main ( String [ ] args ) { String str = "99100" ; Console . WriteLine ( " String : ▁ " + str ) ; int start = isConsecutive ( str ) ; if ( start != - 1 ) Console . WriteLine ( " Yes ▁ STRNEWLINE " + start ) ; else Console . WriteLine ( " No " ) ; String str1 = "121315" ; Console . WriteLine ( " String : " start = isConsecutive ( str1 ) ; if ( start != - 1 ) Console . WriteLine ( " Yes ▁ STRNEWLINE " + start ) ; else Console . WriteLine ( " No " ) ; } }
Converting one string to other using append and delete last operations | C # Program to convert str1 to str2 in exactly k operations ; Returns true if it is possible to convert str1 to str2 using k operations . ; Case A ( i ) ; finding common length of both string ; Case A ( ii ) - ; Case B ; Driver program
using System ; class GFG { static bool isConvertible ( string str1 , string str2 , int k ) { if ( ( str1 . Length + str2 . Length ) < k ) return true ; int commonLength = 0 ; for ( int i = 0 ; i < Math . Min ( str1 . Length , str2 . Length ) ; i ++ ) { if ( str1 == str2 ) commonLength ++ ; else break ; } if ( ( k - str1 . Length - str2 . Length + 2 * commonLength ) % 2 == 0 ) return true ; return false ; } public static void Main ( ) { string str1 = " geek " ; string str2 = " geek " ; int k = 7 ; if ( isConvertible ( str1 , str2 , k ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; str1 = " geeks " ; str2 = " geek " ; k = 5 ; if ( isConvertible ( str1 , str2 , k ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }