codeparrot/xlcost-text-to-code huggingface dataset:
Sum of subtree depths for every node of a given Binary Tree | C # program for the above approach ; Binary tree node ; Function to allocate a new node with the given data and null in its left and right pointers ; DFS function to calculate the sum of depths of all subtrees depth sum ; Store total number of node in its subtree and total sum of depth in its subtree ; Check if left is not null ; Call recursively the DFS function for left child ; Increment the sum of depths by ptemp . first + p . temp . first ; Increment p . first by count of noded in left subtree ; Check if right is not null ; Call recursively the DFS function for right child ; Increment the sum of depths by ptemp . first + p . temp . first ; Increment p . first by count of nodes in right subtree ; Increment the result by total sum of depth in current subtree ; Return p ; Driver Code ; Given Tree ; Print the result
using System ; public class GFG { static int ans ; class pair { public int first , second ; public pair ( int first , int second ) { this . first = first ; this . second = second ; } } class TreeNode { public int data ; public TreeNode left ; public TreeNode right ; } ; static TreeNode newNode ( int data ) { TreeNode Node = new TreeNode ( ) ; Node . data = data ; Node . left = null ; Node . right = null ; return ( Node ) ; } static pair sumofsubtree ( TreeNode root ) { pair p = new pair ( 1 , 0 ) ; if ( root . left != null ) { pair ptemp = sumofsubtree ( root . left ) ; p . second += ptemp . first + ptemp . second ; p . first += ptemp . first ; } if ( root . right != null ) { pair ptemp = sumofsubtree ( root . right ) ; p . second += ptemp . first + ptemp . second ; p . first += ptemp . first ; } ans += p . second ; return p ; } public static void Main ( String [ ] args ) { TreeNode root = newNode ( 1 ) ; root . left = newNode ( 2 ) ; root . right = newNode ( 3 ) ; root . left . left = newNode ( 4 ) ; root . left . right = newNode ( 5 ) ; root . right . left = newNode ( 6 ) ; root . right . right = newNode ( 7 ) ; root . left . left . left = newNode ( 8 ) ; root . left . left . right = newNode ( 9 ) ; ans = 0 ; sumofsubtree ( root ) ; Console . Write ( ans ) ; } }
Minimum time required to fill given N slots | C # program for the above approach ; Function to return the minimum time to fill all the slots ; Stores visited slots ; Checks if a slot is visited or not ; Insert all filled slots ; Iterate until queue is not empty ; Iterate through all slots in the queue ; Front index ; If previous slot is present and not visited ; If next slot is present and not visited ; Increment the time at each level ; Print the answer ; Driver Code ; Function Call
using System ; using System . Collections . Generic ; class GFG { static void minTime ( List < int > arr , int N , int K ) { Queue < int > q = new Queue < int > ( ) ; int [ ] vis = new int [ N + 1 ] ; Array . Clear ( vis , 0 , vis . Length ) ; int time = 0 ; for ( int i = 0 ; i < K ; i ++ ) { q . Enqueue ( arr [ i ] ) ; vis [ arr [ i ] ] = 1 ; } while ( q . Count > 0 ) { for ( int i = 0 ; i < q . Count ; i ++ ) { int curr = q . Peek ( ) ; q . Dequeue ( ) ; if ( curr - 1 >= 1 && vis [ curr - 1 ] == 0 ) { vis [ curr - 1 ] = 1 ; q . Enqueue ( curr - 1 ) ; } if ( curr + 1 <= N && vis [ curr + 1 ] == 0 ) { vis [ curr + 1 ] = 1 ; q . Enqueue ( curr + 1 ) ; } } time ++ ; } Console . WriteLine ( time - 1 ) ; } public static void Main ( ) { int N = 6 ; List < int > arr = new List < int > ( ) { 2 , 6 } ; int K = arr . Count ; minTime ( arr , N , K ) ; } }
Count of integers having difference with its reverse equal to D | C # program for the above approach ; Maximum digits in N ; Utility function to find count of N such that N + D = reverse ( N ) ; If d is a multiple of 9 , no such value N found ; Divide D by 9 check reverse of number and its sum ; B [ i ] : Stores power of ( 10 , i ) ; Calculate power ( 10 , i ) ; Update B [ i ] ; Stores count of N such that N + D = reverse ( N ) ; Iterate over the range [ 1 , MAXL ] ; Update ans ; Function to find count of possible values of N such that N + D = reverse ( N ) ; Base Case ; If D is not qual to 0 ; Stores count of possible values of N such that N + D = reverse ( N ) ; Update ans ; If l is even ; Update ans ; Stores count of possible values of N such that N + D = reverse ( N ) ; Iterae over the range [ - 9 , 9 ] ; Update ans ; Driver code ; Function call
using System ; class GFG { static int MAXL = 17 ; static int N ; static long [ ] v ; static long findN ( int D ) { if ( D % 9 != 0 ) return 0 ; D /= 9 ; long [ ] B = new long [ MAXL ] ; B [ 0 ] = 1 ; for ( int i = 1 ; i < MAXL ; i ++ ) { B [ i ] = B [ i - 1 ] * 10 ; } long ans = 0 ; for ( int i = 1 ; i <= MAXL ; i ++ ) { N = ( i + 1 ) / 2 ; v = new long [ N ] ; for ( int j = 0 ; j < N ; j ++ ) for ( int k = j ; k < i - j ; k ++ ) v [ j ] += B [ k ] ; ans += count ( D , i , 0 , new int [ N ] ) ; } return ans ; } static long count ( long D , int l , int t , int [ ] x ) { if ( t == N ) { if ( D != 0 ) return 0 ; long ans = 1 ; for ( int i = 0 ; i < N ; i ++ ) { ans *= ( i == 0 ? 9 : 10 ) - Math . Abs ( x [ i ] ) ; } if ( l % 2 == 0 ) { ans *= 10 ; } return ans ; } long anss = 0 ; for ( int m = - 9 ; m <= 9 ; m ++ ) { if ( - v [ t ] < D + v [ t ] * m && D + v [ t ] * m < v [ t ] ) { x [ t ] = m ; anss += count ( D + v [ t ] * m , l , t + 1 , x ) ; } } return anss ; } public static void Main ( String [ ] args ) { int D = 63 ; Console . WriteLine ( findN ( D ) ) ; } }
Search for an element in a Mountain Array | C # program for the above approach ; Function to find the index of the peak element in the array ; Stores left most index in which the peak element can be found ; Stores right most index in which the peak element can be found ; Stores mid of left and right ; If element at mid is less than element at ( mid + 1 ) ; Update left ; Update right ; Function to perform binary search in an a subarray if elements of the subarray are in an ascending order ; Stores mid of left and right ; If X found at mid ; If X is greater than mid ; Update left ; Update right ; Function to perform binary search in an a subarray if elements of the subarray are in an ascending order ; Stores mid of left and right ; If X found at mid ; Update right ; Update left ; Function to find the smallest index of X ; Stores index of peak element in array ; Stores index of X in the array ; If X greater than or equal to first element of array and less than the peak element ; Update res ; If element not found on left side of peak element ; Update res ; Print res ; Driver Code ; Given X ; Given array ; Function Call
using System ; using System . Collections . Generic ; using System . Linq ; class GFG { public static int findPeak ( List < int > arr ) { int left = 0 ; int right = arr . Count - 1 ; while ( left < right ) { int mid = left + ( right - left ) / 2 ; if ( arr [ mid ] < arr [ ( mid + 1 ) ] ) { left = mid + 1 ; } else { right = mid ; } } return left ; } static int BS ( int X , int left , int right , List < int > arr ) { while ( left <= right ) { int mid = left + ( right - left ) / 2 ; if ( arr [ ( mid ) ] == X ) { return mid ; } else if ( X > arr [ mid ] ) { left = mid + 1 ; } else { right = mid - 1 ; } } return - 1 ; } static int reverseBS ( int X , int left , int right , List < int > arr ) { while ( left <= right ) { int mid = left + ( right - left ) / 2 ; if ( arr [ mid ] == X ) { return mid ; } else if ( X > arr [ mid ] ) { right = mid - 1 ; } else { left = mid + 1 ; } } return - 1 ; } static void findInMA ( int X , List < int > mountainArr ) { int peakIndex = findPeak ( mountainArr ) ; int res = - 1 ; if ( X >= mountainArr [ 0 ] && X <= mountainArr [ peakIndex ] ) { res = BS ( X , 0 , peakIndex , mountainArr ) ; } if ( res == - 1 ) { res = reverseBS ( X , peakIndex + 1 , mountainArr . Count - 1 , mountainArr ) ; } Console . WriteLine ( res ) ; } public static void Main ( ) { int X = 3 ; List < int > list = new List < int > ( ) { 1 , 2 , 3 , 4 , 5 , 3 , 1 } ; findInMA ( X , list ) ; } }
Rearrange given array to obtain positive prefix sums at exactly X indices | C # program for the above approach ; Function to rearrange the array according to the given condition ; Using 2 nd operation making all values positive ; Sort the array ; Assign K = N - K ; Count number of zeros ; If number of zeros if greater ; Using 2 nd operation convert it into one negative ; Using 2 nd operation convert it into one negative ; Print the array ; Driver Code ; Function Call
using System ; class GFG { static int count ( int [ ] a ) { int counter = 0 ; for ( int i = 0 ; i < a . Length ; i ++ ) { if ( a [ i ] == 0 ) { counter ++ ; } } return counter ; } static void rearrange ( int [ ] a , int n , int x ) { for ( int i = 0 ; i < n ; i ++ ) a [ i ] = Math . Abs ( a [ i ] ) ; Array . Sort ( a ) ; x = n - x ; int z = count ( a ) ; if ( x > n - z ) { Console . WriteLine ( " - 1" ) ; return ; } for ( int i = 0 ; i < n && x > 0 ; i += 2 ) { a [ i ] = - a [ i ] ; x -- ; } for ( int i = n - 1 ; i >= 0 && x > 0 ; i -- ) { if ( a [ i ] > 0 ) { a [ i ] = - a [ i ] ; x -- ; } } for ( int i = 0 ; i < n ; i ++ ) { Console . Write ( a [ i ] + " ▁ " ) ; } } public static void Main ( String [ ] args ) { int [ ] arr = { 0 , - 2 , 4 , 5 , - 3 } ; int K = 3 ; int N = arr . Length ; rearrange ( arr , N , K ) ; } }
Maximize product of a strictly increasing or decreasing subarray | C # program to implement the above approach ; Function to find the maximum product of subarray in the array , [ ] arr ; Maximum positive product ending at the i - th index ; Minimum negative product ending at the current index ; Maximum product up to i - th index ; Check if an array element is positive or not ; Traverse the array ; If current element is positive ; Update max_ending_here ; Update min_ending_here ; Update flag ; If current element is 0 , reset the start index of subarray ; Update max_ending_here ; Update min_ending_here ; If current element is negative ; Stores max_ending_here ; Update max_ending_here ; Update min_ending_here ; Update max_so_far , if needed ; If no array elements is positive and max_so_far is 0 ; Function to find the maximum product of either increasing subarray or the decreasing subarray ; Stores start index of either increasing subarray or the decreasing subarray ; Initially assume maxProd to be 1 ; Traverse the array ; Store the longest either increasing subarray or the decreasing subarray whose start index is i ; Check for increasing subarray ; Insert elements of increasing subarray ; Check for decreasing subarray ; Insert elements of decreasing subarray ; Stores maximum subarray product of current increasing or decreasing subarray ; Update maxProd ; Update i ; Finally print maxProd ; Driver Code
using System ; using System . Collections . Generic ; public class GFG { static int maxSubarrayProduct ( List < int > arr , int n ) { int max_ending_here = 1 ; int min_ending_here = 1 ; int max_so_far = 0 ; int flag = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] > 0 ) { max_ending_here = max_ending_here * arr [ i ] ; min_ending_here = Math . Min ( min_ending_here * arr [ i ] , 1 ) ; flag = 1 ; } else if ( arr [ i ] == 0 ) { max_ending_here = 1 ; min_ending_here = 1 ; } else { int temp = max_ending_here ; max_ending_here = Math . Max ( min_ending_here * arr [ i ] , 1 ) ; min_ending_here = temp * arr [ i ] ; } if ( max_so_far < max_ending_here ) max_so_far = max_ending_here ; } if ( flag == 0 && max_so_far == 0 ) return 0 ; return max_so_far ; } static int findMaxProduct ( int [ ] a , int n ) { int i = 0 ; int maxProd = 1 ; while ( i < n ) { List < int > v = new List < int > ( ) ; v . Add ( a [ i ] ) ; if ( i < n - 1 && a [ i ] < a [ i + 1 ] ) { while ( i < n - 1 && a [ i ] < a [ i + 1 ] ) { v . Add ( a [ i + 1 ] ) ; i += 1 ; } } else if ( i < n - 1 && a [ i ] > a [ i + 1 ] ) { while ( i < n - 1 && a [ i ] > a [ i + 1 ] ) { v . Add ( a [ i + 1 ] ) ; i += 1 ; } } int prod = maxSubarrayProduct ( v , v . Count ) ; maxProd = Math . Max ( maxProd , prod ) ; i ++ ; } return maxProd ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 2 , 10 , 8 , 1 , 100 , 101 } ; int N = arr . Length ; Console . Write ( findMaxProduct ( arr , N ) ) ; } }
Number of connected components of a graph ( using Disjoint Set Union ) | C # program for the above approach ; Stores the parent of each vertex ; Function to find the topmost parent of vertex a ; If current vertex is the topmost vertex ; Otherwise , set topmost vertex of its parent as its topmost vertex ; Function to connect the component having vertex a with the component having vertex b ; Connect edges ; Function to find unique top most parents ; Traverse all vertices ; Insert all topmost vertices obtained ; Print count of connected components ; Function to print answer ; Setting parent to itself ; Traverse all edges ; Print answer ; Driver code ; Given N ; Given edges ; Function call
using System ; using System . Collections . Generic ; class GFG { static int [ ] parent = new int [ 1000000 ] ; static int root ( int a ) { if ( a == parent [ a ] ) { return a ; } return parent [ a ] = root ( parent [ a ] ) ; } static void connect ( int a , int b ) { a = root ( a ) ; b = root ( b ) ; if ( a != b ) { parent [ b ] = a ; } } static void connectedComponents ( int n ) { HashSet < int > s = new HashSet < int > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { s . Add ( parent [ i ] ) ; } Console . WriteLine ( s . Count ) ; } static void printAnswer ( int N , List < List < int > > edges ) { for ( int i = 0 ; i <= N ; i ++ ) { parent [ i ] = i ; } for ( int i = 0 ; i < edges . Count ; i ++ ) { connect ( edges [ i ] [ 0 ] , edges [ i ] [ 1 ] ) ; } connectedComponents ( N ) ; } static void Main ( ) { int N = 8 ; List < List < int > > edges = new List < List < int > > ( ) ; edges . Add ( new List < int > { 1 , 0 } ) ; edges . Add ( new List < int > { 0 , 2 } ) ; edges . Add ( new List < int > { 5 , 3 } ) ; edges . Add ( new List < int > { 3 , 4 } ) ; edges . Add ( new List < int > { 6 , 7 } ) ; printAnswer ( N , edges ) ; } }
Remove all zero | C # program for the above approach ; Function to remove the rows or columns from the matrix which contains all 0 s elements ; Stores count of rows ; col [ i ] : Stores count of 0 s in current column ; row [ i ] : Stores count of 0 s in current row ; Traverse the matrix ; Stores count of 0 s in current row ; Update col [ j ] ; Update count ; Update row [ i ] ; Traverse the matrix ; If all elements of current row is 0 ; If all elements of current column is 0 ; Driver Code ; Function Call
using System ; class GFG { static void removeZeroRowCol ( int [ , ] arr ) { int n = arr . GetLength ( 0 ) ; int [ ] col = new int [ n + 1 ] ; int [ ] row = new int [ n + 1 ] ; for ( int i = 0 ; i < n ; ++ i ) { int count = 0 ; for ( int j = 0 ; j < n ; ++ j ) { if ( arr [ i , j ] == 1 ) col [ j ] += 1 ; else col [ j ] += 0 ; if ( arr [ i , j ] == 1 ) count += 1 ; else count += 0 ; } row [ i ] = count ; } for ( int i = 0 ; i < n ; ++ i ) { if ( row [ i ] == 0 ) { continue ; } for ( int j = 0 ; j < n ; ++ j ) { if ( col [ j ] != 0 ) Console . Write ( arr [ i , j ] ) ; } Console . WriteLine ( ) ; } } public static void Main ( String [ ] args ) { int [ , ] arr = { { 1 , 1 , 0 , 1 } , { 0 , 0 , 0 , 0 } , { 1 , 1 , 0 , 1 } , { 0 , 1 , 0 , 1 } } ; removeZeroRowCol ( arr ) ; } }
Find a pair of overlapping intervals from a given Set | C # program to implement the above approach ; Function to find a pair ( i , j ) such that i - th interval lies within the j - th interval ; Store interval and index of the interval in the form of { { l , r } , index } ; Traverse the array , arr [ ] [ ] ; Stores l - value of the interval ; Stores r - value of the interval ; Push current interval and index into tup ; Sort the vector based on l - value of the intervals ; Stores r - value of current interval ; Stores index of current interval ; Traverse the vector , tup [ ] ; Stores l - value of previous interval ; Stores l - value of current interval ; If Q and R are equal ; Print the index of interval ; Stores r - value of current interval ; If T is less than or equal to curr ; Update curr ; Update currPos ; If such intervals found ; Driver code ; Given l - value of segments ; Given r - value of segments ; Given size ; Function Call
using System ; using System . Collections . Generic ; class GFG { static void findOverlapSegement ( int N , int [ ] a , int [ ] b ) { List < Tuple < Tuple < int , int > , int > > tup = new List < Tuple < Tuple < int , int > , int > > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { int x , y ; x = a [ i ] ; y = b [ i ] ; tup . Add ( new Tuple < Tuple < int , int > , int > ( new Tuple < int , int > ( x , y ) , i ) ) ; } tup . Sort ( ) ; int curr = tup [ 0 ] . Item1 . Item2 ; int currPos = tup [ 0 ] . Item2 ; for ( int i = 1 ; i < N ; i ++ ) { int Q = tup [ i - 1 ] . Item1 . Item1 ; int R = tup [ i ] . Item1 . Item1 ; if ( Q == R ) { if ( tup [ i - 1 ] . Item1 . Item2 < tup [ i ] . Item1 . Item2 ) Console . Write ( tup [ i - 1 ] . Item2 + " ▁ " + tup [ i ] . Item2 ) ; else Console . Write ( tup [ i ] . Item2 + " ▁ " + tup [ i - 1 ] . Item2 ) ; return ; } int T = tup [ i ] . Item1 . Item2 ; if ( T <= curr ) { Console . Write ( tup [ i ] . Item2 + " ▁ " + currPos ) ; return ; } else { curr = T ; currPos = tup [ i ] . Item2 ; } } Console . Write ( " - 1 ▁ - 1" ) ; } static void Main ( ) { int [ ] a = { 1 , 2 , 3 , 2 , 2 } ; int [ ] b = { 5 , 10 , 10 , 2 , 15 } ; int N = a . Length ; findOverlapSegement ( N , a , b ) ; } }
Count maximum concatenation of pairs from given array that are divisible by 3 | C # program to implement the above approach ; Function to count pairs whose concatenation is divisible by 3 and each element can be present in at most one pair ; Stores count pairs whose concatenation is divisible by 3 and each element can be present in at most one pair ; Check if an element present in any pair or not ; Generate all possible pairs ; If the element already present in a pair ; If the element already present in a pair ; If concatenation of elements is divisible by 3 ; Update ans ; Mark i is True ; Mark j is True ; Driver Code ; To display the result
using System ; public class GFG { public static int countDivBy3InArray ( int [ ] arr ) { int ans = 0 ; bool [ ] taken = new bool [ arr . Length ] ; for ( int i = 0 ; i < arr . Length ; i ++ ) { if ( taken [ i ] == true ) { continue ; } for ( int j = i + 1 ; j < arr . Length ; j ++ ) { if ( taken [ j ] == true ) { continue ; } if ( Int32 . Parse ( ( arr [ i ] ) . ToString ( ) + ( arr [ j ] ) . ToString ( ) ) % 3 == 0 || Int32 . Parse ( ( arr [ j ] ) . ToString ( ) + ( arr [ i ] ) . ToString ( ) ) % 3 == 0 ) { ans += 1 ; taken [ i ] = true ; taken [ j ] = true ; } } } return ans ; } public static void Main ( String [ ] args ) { int [ ] arr = { 5 , 3 , 2 , 8 , 7 } ; Console . WriteLine ( countDivBy3InArray ( arr ) ) ; } }
Maximum average of subtree values in a given Binary Tree | C # program for the above approach ; Structure of the Tree node ; Stores the result ; Function for finding maximum subtree average ; Checks if current node is not null and doesn 't have any children ; Stores sum of its subtree in index 0 and count number of nodes in index 1 ; Traverse all children of the current node ; Recursively calculate max average of subtrees among its children ; Increment sum by sum of its child 's subtree ; Increment number of nodes by its child 's node ; Increment sum by current node 's value ; Increment number of nodes by one ; Take maximum of ans and current node 's average ; Finally return pair of { sum , count } ; Driver code ; Given tree ; Function call ; Print answer
using System ; using System . Collections . Generic ; using System . Globalization ; public class TreeNode { public int val ; public List < TreeNode > children ; public TreeNode ( int v ) { val = v ; children = new List < TreeNode > ( ) ; } } public class GFG { static double ans = 0.0 ; public static double [ ] MaxAverage ( TreeNode root ) { if ( root . children != null && root . children . Count == 0 ) { ans = Math . Max ( ans , root . val ) ; return new double [ ] { root . val , 1 } ; } double [ ] childResult = new double [ 2 ] ; foreach ( TreeNode child in root . children ) { double [ ] childTotal = MaxAverage ( child ) ; childResult [ 0 ] = childResult [ 0 ] + childTotal [ 0 ] ; childResult [ 1 ] = childResult [ 1 ] + childTotal [ 1 ] ; } double sum = childResult [ 0 ] + root . val ; double count = childResult [ 1 ] + 1 ; ans = Math . Max ( ans , sum / count ) ; return new double [ ] { sum , count } ; } static public void Main ( ) { TreeNode root = new TreeNode ( 20 ) ; TreeNode left = new TreeNode ( 12 ) ; TreeNode right = new TreeNode ( 18 ) ; root . children . Add ( left ) ; root . children . Add ( right ) ; left . children . Add ( new TreeNode ( 11 ) ) ; left . children . Add ( new TreeNode ( 3 ) ) ; right . children . Add ( new TreeNode ( 15 ) ) ; right . children . Add ( new TreeNode ( 8 ) ) ; MaxAverage ( root ) ; NumberFormatInfo setPrecision = new NumberFormatInfo ( ) ; setPrecision . NumberDecimalDigits = 1 ; Console . WriteLine ( ans . ToString ( " N " , setPrecision ) ) ; } }
Check if a Binary String can be converted to another by reversing substrings consisting of even number of 1 s | C # program for the above approach ; Function to check if string A can be transformed to string B by reversing substrings of A having even number of 1 s ; Store the size of string A ; Store the size of string B ; Store the count of 1 s in A and B ; Stores cntA for string A and cntB for string B ; Traverse the string A ; If current character is 1 ; Increment 1 s count ; Otherwise , update odd1A or even1A depending whether count1A is odd or even ; Traverse the string B ; If current character is 1 ; Increment 1 s count ; Otherwise , update odd1B or even1B depending whether count1B is odd or even ; If the condition is satisfied ; If true , print Yes ; Otherwise , print No ; Driver Code ; Function Call
using System ; using System . Collections ; class GFG { static void canTransformStrings ( string A , string B ) { int n1 = A . Length ; int n2 = B . Length ; int count1A = 0 , count1B = 0 ; int odd1A = 0 , odd1B = 0 ; int even1A = 0 , even1B = 0 ; for ( int i = 0 ; i < n1 ; i ++ ) { if ( A [ i ] == '1' ) count1A ++ ; else { if ( ( count1A & 1 ) == 1 ) odd1A ++ ; else even1A ++ ; } } for ( int i = 0 ; i < n2 ; i ++ ) { if ( B [ i ] == '1' ) count1B ++ ; else { if ( ( count1B & 1 ) == 1 ) odd1B ++ ; else even1B ++ ; } } if ( count1A == count1B && odd1A == odd1B && even1A == even1B ) { Console . Write ( " Yes " ) ; } else Console . Write ( " No " ) ; } static void Main ( ) { string A = "10011" , B = "11100" ; canTransformStrings ( A , B ) ; } }