codeparrot/xlcost-text-to-code huggingface dataset:
Construct the Cypher string based on the given conditions | C # program for the above approach ; Function to check whether a number is prime or not ; Function to check if a prime number can be expressed as sum of two Prime Numbers ; If the N && ( N - 2 ) is Prime ; Function to check semiPrime ; Loop from 2 to Math . Sqrt ( num ) ; Increment the count of prime numbers ; If num is greater than 1 , then add 1 to it ; Return '1' if count is 2 else return '0' ; Function to make the Cypher String ; Resultant String ; Make String for the number N ; Check for semiPrime ; Traverse to make Cypher String ; If index is odd add the current character ; Else current character is changed ; Check for sum of two primes ; Traverse to make Cypher String ; If index is odd then current character is changed ; Else add the current character ; If the resultant String is " " then print - 1 ; Else print the resultant String ; Driver Code ; Given Number ; Function Call
using System ; class GFG { static bool isPrime ( int n ) { if ( n <= 1 ) return false ; for ( int i = 2 ; i <= Math . Sqrt ( n ) ; i ++ ) { if ( n % i == 0 ) return false ; } return true ; } static bool isPossibleSum ( int N ) { if ( isPrime ( N ) && isPrime ( N - 2 ) ) { return true ; } else { return false ; } } static bool checkSemiprime ( int num ) { int cnt = 0 ; for ( int i = 2 ; cnt < 2 && i * i <= num ; ++ i ) { while ( num % i == 0 ) { num /= i ; ++ cnt ; } } if ( num > 1 ) { ++ cnt ; } return cnt == 2 ; } static void makeCypherString ( int N ) { String semiPrime = " " ; String sumOfPrime = " " ; String str = String . Join ( " " , N ) ; if ( checkSemiprime ( N ) ) { for ( int i = 0 ; i < str . Length ; i ++ ) { if ( i % 2 == 1 ) { semiPrime += str [ i ] ; } else { semiPrime += ( char ) ( str [ i ] - '0' + 65 ) ; } } } if ( isPossibleSum ( N ) ) { for ( int i = 0 ; i < str . Length ; i ++ ) { if ( i % 2 == 1 ) { sumOfPrime += ( char ) ( str [ i ] - '0' + 65 ) ; } else { sumOfPrime += str [ i ] ; } } } if ( semiPrime + sumOfPrime == " " ) { Console . Write ( " - 1" ) ; } else { Console . Write ( semiPrime + sumOfPrime ) ; } } public static void Main ( String [ ] args ) { int N = 1011243 ; makeCypherString ( N ) ; } }
Maximum splits in binary string such that each substring is divisible by given odd number | C # program to split a given binary string into maximum possible segments divisible by given odd number K ; Function to calculate maximum splits possible ; Driver code
using System ; class GFG { static void max_segments ( string str , int K ) { int n = str . Length ; int s = 0 ; int sum = 0 ; int count = 0 ; for ( int i = n - 1 ; i >= 0 ; i -- ) { int a = str [ i ] - '0' ; sum += a * ( int ) Math . Pow ( 2 , s ) ; s ++ ; if ( sum != 0 && sum % K == 0 ) { count ++ ; sum = 0 ; s = 0 ; } } if ( sum != 0 ) { Console . Write ( " - 1" ) ; } else { Console . Write ( count ) ; } } public static void Main ( ) { string str = "10111001" ; int K = 5 ; max_segments ( str , K ) ; } }
Make the string lexicographically smallest and non palindromic by replacing exactly one character | C # program to make the string lexicographically smallest non palindromic string by replacing exactly one character ; Function to find the required string ; Length of the string ; Iterate till half of the string ; Replacing a non ' a ' char with ' a ' ; Check if there is no ' a ' in string we replace last char of string by ' b ' ; If the input is a single character ; Driver code
using System ; class GFG { static String findStr ( char [ ] S ) { int n = S . Length ; for ( int i = 0 ; i < n / 2 ; ++ i ) { if ( S [ i ] != ' a ' ) { S [ i ] = ' a ' ; return new String ( S ) ; } } S [ n - 1 ] = ' b ' ; return n < 2 ? " ▁ - 1 ▁ " : new String ( S ) ; } public static void Main ( String [ ] args ) { String str = " a " ; Console . WriteLine ( findStr ( str . ToCharArray ( ) ) ) ; String str1 = " abccba " ; Console . WriteLine ( findStr ( str1 . ToCharArray ( ) ) ) ; } }
Find the k | C # program find the Kth String in lexicographical order consisting of N - 2 xs and 2 ys ; Function to find the Kth String in lexicographical order which consists of N - 2 xs and 2 ys ; Iterate for all possible positions of eft most Y ; If i is the left most position of Y ; Put Y in their positions ; Driver code ; Function call
using System ; class GFG { static void kth_String ( int n , int k ) { for ( int i = n - 2 ; i >= 0 ; i -- ) { if ( k <= ( n - i - 1 ) ) { for ( int j = 0 ; j < n ; j ++ ) { if ( j == i j == n - k ) Console . Write ( ' Y ' ) ; else Console . Write ( ' X ' ) ; } break ; } k -= ( n - i - 1 ) ; } } public static void Main ( String [ ] args ) { int n = 5 , k = 7 ; kth_String ( n , k ) ; } }
Transform string str1 into str2 by taking characters from string str3 | C # program of the above approach ; Function to check whether str1 can be transformed to str2 ; To store the frequency of characters of String str3 ; Declare two pointers & flag ; Traverse both the String and check whether it can be transformed ; If both pointers point to same characters increment them ; If the letters don 't match check  if we can find it in String C ; If the letter is available in String str3 , decrement it 's  frequency & increment the ptr2 ; If letter isn 't present in str3[]  set the flag to false and break ; If the flag is true and both pointers points to their end of respective Strings then it is possible to transformed str1 into str2 , otherwise not . ; Driver Code ; Function Call
using System ; using System . Collections . Generic ; class GFG { static void convertString ( String str1 , String str2 , String str3 ) { Dictionary < char , int > freq = new Dictionary < char , int > ( ) ; for ( int i = 0 ; i < str3 . Length ; i ++ ) { if ( freq . ContainsKey ( str3 [ i ] ) ) freq [ str3 [ i ] ] = freq [ str3 [ i ] ] + 1 ; else freq . Add ( str3 [ i ] , 1 ) ; } int ptr1 = 0 ; int ptr2 = 0 ; bool flag = true ; while ( ptr1 < str1 . Length && ptr2 < str2 . Length ) { if ( str1 [ ptr1 ] == str2 [ ptr2 ] ) { ptr1 ++ ; ptr2 ++ ; } else { if ( freq . ContainsKey ( str3 [ ptr2 ] ) ) if ( freq [ str3 [ ptr2 ] ] > 0 ) { freq [ str3 [ ptr2 ] ] = freq [ str3 [ ptr2 ] ] - 1 ; ptr2 ++ ; } else { flag = false ; break ; } } } if ( flag && ptr1 == str1 . Length && ptr2 == str2 . Length ) { Console . Write ( " YES " + " STRNEWLINE " ) ; } else { Console . Write ( " NO " + " STRNEWLINE " ) ; } } public static void Main ( String [ ] args ) { String str1 = " abyzfe " ; String str2 = " abcdeyzf " ; String str3 = " popode " ; convertString ( str1 , str2 , str3 ) ; } }
Decrypt the String according to given algorithm | C # implementation of the approach ; Function that returns ( num % 26 ) ; Initialize result ; One by one process all digits of ' num ' ; Function to return the decrypted String ; To store the readonly decrypted answer ; One by one check for each character if it is a numeric character ; Modulo the number found in the String by 26 ; Driver code ; Print the decrypted string
using System ; class GFG { static int MOD = 26 ; static int modulo_by_26 ( String num ) { int res = 0 ; for ( int i = 0 ; i < num . Length ; i ++ ) { res = ( ( res * 10 + ( int ) num [ i ] - '0' ) % MOD ) ; } return res ; } static String decrypt_message ( String s ) { String decrypted_str = " " ; String num_found_so_far = " " ; for ( int i = 0 ; i < s . Length ; ++ i ) { if ( s [ i ] >= '0' && s [ i ] <= '9' ) { num_found_so_far += s [ i ] ; } else if ( num_found_so_far . Length > 0 ) { decrypted_str += ( char ) ( ' a ' + modulo_by_26 ( num_found_so_far ) ) ; num_found_so_far = " " ; } } if ( num_found_so_far . Length > 0 ) { decrypted_str += ( char ) ( ' a ' + modulo_by_26 ( num_found_so_far ) ) ; } return decrypted_str ; } public static void Main ( String [ ] args ) { String s = "32ytAAcV4ui30hf10hj18" ; Console . Write ( decrypt_message ( s ) ) ; } }
Maximum number of overlapping string | C # implementation to find the maximum number of occurrence of the overlapping count ; Function to find the maximum overlapping Strings ; Get the current character ; Condition to check if the current character is the first character of the String T then increment the overlapping count ; Condition to check previous character is also occurred ; Update count of previous and current character ; Condition to check the current character is the last character of the String T ; Condition to check the every subsequence is a valid String T ; Driver code ; Function call
using System ; class GFG { static int maxOverlap ( String S , String T ) { String str = T ; int [ ] count = new int [ T . Length ] ; int overlap = 0 ; int max_overlap = 0 ; for ( int i = 0 ; i < S . Length ; i ++ ) { int index = str . IndexOf ( S [ i ] ) ; if ( index == 0 ) { overlap ++ ; if ( overlap >= 2 ) { max_overlap = Math . Max ( overlap , max_overlap ) ; } count [ index ] ++ ; } else { if ( count [ index - 1 ] <= 0 ) return - 1 ; count [ index ] ++ ; count [ index - 1 ] -- ; } if ( index == 4 ) overlap -- ; } if ( overlap == 0 ) return max_overlap ; else return - 1 ; } public static void Main ( String [ ] args ) { String S = " chcirphirp " ; String T = " chirp " ; Console . Write ( maxOverlap ( S , T ) ) ; } }
Minimum number of operations required to make two strings equal | C # implementation to find the minimum number of operations to make two Strings equal ; Function to find out parent of an alphabet ; Function to merge two different alphabets ; Merge a and b using rank compression ; Function to find the minimum number of operations required ; Initializing parent to i and rank ( size ) to 1 ; We will store our answer in this vector ; Traversing Strings ; If they have different parents ; Find their respective parents and merge them ; Store this in our Answer vector ; Number of operations ; Driver Code ; Two Strings S1 and S2 ; Function call
using System ; using System . Collections . Generic ; class GFG { static readonly int MAX = 500001 ; static int [ ] parent = new int [ MAX ] ; static int [ ] Rank = new int [ MAX ] ; class pair { public char first , second ; public pair ( char first , char second ) { this . first = first ; this . second = second ; } } static int find ( int x ) { return parent [ x ] = parent [ x ] == x ? x : find ( parent [ x ] ) ; } static void merge ( int r1 , int r2 ) { if ( r1 != r2 ) { if ( Rank [ r1 ] > Rank [ r2 ] ) { parent [ r2 ] = r1 ; Rank [ r1 ] += Rank [ r2 ] ; } else { parent [ r1 ] = r2 ; Rank [ r2 ] += Rank [ r1 ] ; } } } static void minimumOperations ( String s1 , String s2 ) { for ( int i = 1 ; i <= 26 ; i ++ ) { parent [ i ] = i ; Rank [ i ] = 1 ; } List < pair > ans = new List < pair > ( ) ; for ( int i = 0 ; i < s1 . Length ; i ++ ) { if ( s1 [ i ] != s2 [ i ] ) { if ( find ( s1 [ i ] - 96 ) != find ( s2 [ i ] - 96 ) ) { int x = find ( s1 [ i ] - 96 ) ; int y = find ( s2 [ i ] - 96 ) ; merge ( x , y ) ; ans . Add ( new pair ( s1 [ i ] , s2 [ i ] ) ) ; } } } Console . Write ( ans . Count + " STRNEWLINE " ) ; for ( int i = 0 ; i < ans . Count ; i ++ ) Console . Write ( ans [ i ] . first + " - > " + ans [ i ] . second + " STRNEWLINE " ) ; } public static void Main ( String [ ] args ) { String s1 , s2 ; s1 = " abb " ; s2 = " dad " ; minimumOperations ( s1 , s2 ) ; } }
Find the N | C # program to find the N - th lexicographic permutation of String using Factroid method ; Function to calculate nth permutation of String ; Creating an empty stack ; Subtracting 1 from N because the permutations start from 0 in factroid method ; Loop to generate the factroid of the sequence ; Loop to generate nth permutation ; Remove 1 - element in each cycle ; Final answer ; Driver code
using System ; using System . Collections . Generic ; class GFG { static void String_permutation ( int n , String str ) { Stack < int > s = new Stack < int > ( ) ; String result = " " ; n = n - 1 ; for ( int i = 1 ; i < str . Length + 1 ; i ++ ) { s . Push ( n % i ) ; n = n / i ; } for ( int i = 0 ; i < str . Length ; i ++ ) { int a = s . Peek ( ) ; result += str [ a ] ; int j ; for ( j = a ; j < str . Length - 1 ; j ++ ) { str = str . Substring ( 0 , j ) + str [ j + 1 ] + str . Substring ( j + 1 ) ; } str = str . Substring ( 0 , j + 1 ) ; s . Pop ( ) ; } Console . Write ( result + " STRNEWLINE " ) ; } public static void Main ( String [ ] args ) { String str = " abcde " ; int n = 11 ; String_permutation ( n , str ) ; } }
Defanged Version of Internet Protocol Address | C # implementation to find the defanged version of the IP address ; Function to generate a defanged version of IP address . ; Loop to iterate over the characters of the string ; Driver Code
using System ; class GFG { static String GeberateDefangIP ( string str ) { string defangIP = " " ; for ( int i = 0 ; i < str . Length ; i ++ ) { char c = str [ i ] ; if ( c == ' . ' ) { defangIP += " [ . ] " ; } else { defangIP += c ; } } return defangIP ; } public static void Main ( ) { string str = "255.100.50.0" ; Console . Write ( GeberateDefangIP ( str ) ) ; } }
Generate a string with maximum possible alphabets with odd frequencies | C # program to generate a string of length n with maximum possible alphabets with each of them occuring odd number of times . ; Function to generate a string of length n with maximum possible alphabets each occuring odd number of times . ; If n is odd ; Add all characters from b - y ; Append a to fill the remaining length ; If n is even ; Add all characters from b - z ; Append a to fill the remaining length ; Driven code
using System ; class GFG { static string generateTheString ( int n ) { string ans = " " ; if ( n % 2 == 0 ) { for ( int i = 0 ; i < Math . Min ( n , 24 ) ; i ++ ) { ans += ( char ) ( ' b ' + i ) ; } if ( n > 24 ) { for ( int i = 0 ; i < ( n - 24 ) ; i ++ ) ans += ' a ' ; } } else { for ( int i = 0 ; i < Math . Min ( n , 25 ) ; i ++ ) { ans += ( char ) ( ' b ' + i ) ; } if ( n > 25 ) { for ( int i = 0 ; i < ( n - 25 ) ; i ++ ) ans += ' a ' ; } } return ans ; } public static void Main ( ) { int n = 34 ; Console . Write ( generateTheString ( n ) ) ; } }
Move all occurrence of letter ' x ' from the string s to the end using Recursion | C # implementation to Move all occurrence of letter x from the string s to the end using Recursion ; Function to move all ' x ' in the end ; Store current character ; Check if current character is not ' x ' ; recursive function call ; Check if current character is ' x ' ; Driver code
using System ; class GFG { static void moveAtEnd ( string s , int i , int l ) { if ( i >= l ) return ; char curr = s [ i ] ; if ( curr != ' x ' ) Console . Write ( curr ) ; moveAtEnd ( s , i + 1 , l ) ; if ( curr == ' x ' ) Console . Write ( curr ) ; return ; } public static void Main ( ) { string s = " geekxsforgexxeksxx " ; int l = s . Length ; moveAtEnd ( s , 0 , l ) ; } }
Construct a string of length L such that each substring of length X has exactly Y distinct letters | C # implementation to construct a string of length L such that each substring of length X has exactly Y distinct letters . ; Initialize p equal to the ASCII value of a ; Iterate till the length of the string ; Driver code
using System ; class GFG { static void String ( int l , int x , int y ) { int p = 97 ; for ( int j = 0 ; j < l ; j ++ ) { char ans = ( char ) ( p + ( j % y ) ) ; Console . Write ( ans ) ; } } public static void Main ( string [ ] args ) { int l = 6 ; int x = 5 ; int y = 3 ; String ( l , x , y ) ; } }
Find the final co | C # implementation of the above approach ; Function to print the readonly position of the point after traversing through the given directions ; Traversing through the given directions ; If its north or south the point will move left or right ; If its west or east the point will move upwards or downwards ; Returning the readonly position ; Driver Code
using System ; class GFG { static void finalCoordinates ( int SX , int SY , char [ ] D ) { for ( int i = 0 ; i < D . Length ; i ++ ) { if ( D [ i ] == ' N ' ) { SY += 1 ; } else if ( D [ i ] == ' S ' ) { SY -= 1 ; } else if ( D [ i ] == ' E ' ) { SX += 1 ; } else { SX -= 1 ; } } String ans = ' ( ' + String . Join ( " " , SX ) + ' , ' + String . Join ( " " , SY ) + ' ) ' ; Console . Write ( ans ) ; } public static void Main ( String [ ] args ) { int SX = 2 , SY = 2 ; String D = " NSSE " ; finalCoordinates ( SX , SY , D . ToCharArray ( ) ) ; } }
Lexicographically all Shortest Palindromic Substrings from a given string | C # program to find Lexicographically all shortest palindromic substrings from a given string ; Function to find all lexicographically shortest palindromic substring ; Array to keep track of alphabetic characters ; Iterate to print all lexicographically shortest substring ; Driver code
using System ; class GFG { static void shortestPalindrome ( string s ) { int [ ] abcd = new int [ 26 ] ; for ( int i = 0 ; i < s . Length ; i ++ ) abcd [ s [ i ] - 97 ] = 1 ; for ( int i = 0 ; i < 26 ; i ++ ) { if ( abcd [ i ] == 1 ) { Console . Write ( ( char ) ( i + 97 ) + " ▁ " ) ; } } } static public void Main ( string [ ] args ) { string s = " geeksforgeeks " ; shortestPalindrome ( s ) ; } }
Remove duplicates from string keeping the order according to last occurrences | C # program to remove duplicate character from character array and print in sorted order ; Used as index in the modified String ; Traverse through all characters ; Check if str [ i ] is present before it ; If not present , then add it to result . ; Driver code
using System ; class GFG { static String removeDuplicates ( String str ) { int n = str . Length ; String res = " " ; for ( int i = 0 ; i < n ; i ++ ) { int j ; for ( j = i + 1 ; j < n ; j ++ ) if ( str [ i ] == str [ j ] ) break ; if ( j == n ) res = res + str [ i ] ; } return res ; } public static void Main ( String [ ] args ) { String str = " geeksforgeeks " ; Console . Write ( removeDuplicates ( str ) ) ; } }
Remove duplicates from string keeping the order according to last occurrences | C # program to remove duplicate character from character array and print in sorted order ; Used as index in the modified String ; Create an empty hash table ; Traverse through all characters from right to left ; If current character is not in ; Reverse the result String ; Driver code
using System ; using System . Collections . Generic ; class GFG { static String removeDuplicates ( String str ) { int n = str . Length ; HashSet < char > s = new HashSet < char > ( ) ; String res = " " ; for ( int i = n - 1 ; i >= 0 ; i -- ) { if ( ! s . Contains ( str [ i ] ) ) { res = res + str [ i ] ; s . Add ( str [ i ] ) ; } } res = reverse ( res ) ; return res ; } static String reverse ( String input ) { char [ ] a = input . ToCharArray ( ) ; int l , r = a . Length - 1 ; for ( l = 0 ; l < r ; l ++ , r -- ) { char temp = a [ l ] ; a [ l ] = a [ r ] ; a [ r ] = temp ; } return String . Join ( " " , a ) ; } public static void Main ( String [ ] args ) { String str = " geeksforgeeks " ; Console . Write ( removeDuplicates ( str ) ) ; } }
Count of numbers in a range that does not contain the digit M and which is divisible by M . | C # implementation to illustrate the program ; Function to count all the numbers which does not contain the digit ' M ' and is divisible by M ; Storing all the distinct digits of a number ; Checking if the two conditions are satisfied or not ; Driver code ; Lower Range ; Upper Range ; The digit
using System ; using System . Collections . Generic ; class GFG { static void contain ( int L , int U , int M ) { int count = 0 ; for ( int j = L ; j < U ; j ++ ) { HashSet < string > num = new HashSet < string > ( ) ; string str = j . ToString ( ) ; num . Add ( str ) ; if ( j % M == 0 && ! num . Contains ( M . ToString ( ) ) ) { count += 1 ; } } Console . Write ( count - 2 ) ; } public static void Main ( string [ ] args ) { int L = 106 ; int U = 200 ; int M = 7 ; contain ( L , U , M ) ; } }
Longest string which is prefix string of at least two strings | C # program to find longest String which is prefix String of at least two Strings ; Function to find Max length of the prefix ; Base case ; Iterating over all the alphabets ; Checking if char exists in current String or not ; If atleast 2 String have that character ; Recursive call to i + 1 ; Driver code ; Initialising Strings ; push Strings into vectors .
using System ; using System . Collections . Generic ; class GFG { static int max1 = 0 ; static int MaxLength ( List < String > v , int i , int m ) { if ( i >= m ) { return m - 1 ; } for ( int k = 0 ; k < 26 ; k ++ ) { char c = ( char ) ( ' a ' + k ) ; List < String > v1 = new List < String > ( ) ; for ( int j = 0 ; j < v . Count ; j ++ ) { if ( v [ j ] [ i ] == c ) { v1 . Add ( v [ j ] ) ; } } if ( v1 . Count >= 2 ) { max1 = Math . Max ( max1 , MaxLength ( v1 , i + 1 , m ) ) ; } else { max1 = Math . Max ( max1 , i - 1 ) ; } } return max1 ; } public static void Main ( String [ ] args ) { String s1 , s2 , s3 , s4 , s5 ; s1 = " abcde " ; s2 = " abcsd " ; s3 = " bcsdf " ; s4 = " abcda " ; s5 = " abced " ; List < String > v = new List < String > ( ) ; v . Add ( s1 ) ; v . Add ( s2 ) ; v . Add ( s3 ) ; v . Add ( s4 ) ; v . Add ( s5 ) ; int m = v [ 0 ] . Length ; Console . Write ( MaxLength ( v , 0 , m ) + 1 ) ; } }
Periodic Binary String With Minimum Period and a Given Binary String as Subsequence . | C # implementation to find the periodic string with minimum period ; Function to find the periodic string with minimum period ; Print the string S if it consists of similar elements ; Find the required periodic string with period 2 ; Driver code
using System ; class GFG { static void findPeriodicString ( string S ) { int l = 2 * S . Length ; int count = 0 ; for ( int i = 0 ; i < S . Length ; i ++ ) { if ( S [ i ] == '1' ) count ++ ; } if ( count == S . Length count == 0 ) Console . WriteLine ( S ) ; else { char [ ] arr = new char [ l ] ; for ( int i = 0 ; i < l ; i += 2 ) { arr [ i ] = '1' ; arr [ i + 1 ] = '0' ; } for ( int i = 0 ; i < l ; i ++ ) Console . Write ( arr [ i ] ) ; Console . WriteLine ( ) ; } } public static void Main ( ) { string S = "1111001" ; findPeriodicString ( S ) ; } }
Count the minimum number of groups formed in a string | C # implementation to Count the minimum number of groups formed in a string by replacing consecutive characters with same single character ; Function to count the minimum number of groups formed in the given string s ; Initializing count as one since the string is not NULL ; Comparing adjacent characters ; Driver Code
using System ; class GFG { static void group_formed ( String S ) { int count = 1 ; for ( int i = 0 ; i < S . Length - 1 ; i ++ ) { if ( S [ i ] != S [ i + 1 ] ) count += 1 ; } Console . Write ( count ) ; } public static void Main ( String [ ] args ) { String S = " TTWWW " ; group_formed ( S ) ; } }
Find the Substring with maximum product | C # program to find the maximum product subString ; Function to return the value of a character ; Function to find the maximum product subString ; To store subStrings ; Check if current product is maximum possible or not ; If product is 0 ; Return the subString with maximum product ; Driver code ; Function call
using System ; public class GFG { static int value ( char x ) { return ( int ) ( x - ' a ' ) ; } static String maximumProduct ( String str , int n ) { String answer = " " , curr = " " ; long maxProduct = 0 , product = 1 ; for ( int i = 0 ; i < n ; i ++ ) { product *= 1L * value ( str [ i ] ) ; curr += str [ i ] ; if ( product >= maxProduct ) { maxProduct = product ; answer = curr ; } if ( product == 0 ) { product = 1 ; curr = " " ; } } return answer ; } public static void Main ( String [ ] args ) { String str = " sdtfakdhdahdzz " ; int n = str . Length ; Console . Write ( maximumProduct ( str , n ) + " STRNEWLINE " ) ; } }