dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; using System . Collections ; class GFG { static bool isSuffix ( String s1 , String s2 ) { int n1 = s1 . Length , n2 = s2 . Length ; if ( n1 > n2 ) return false ; for ( int i = 0 ; i < n1 ; i ++ ) if ( s1 [ n1 - i - 1 ] != s2 [ n2 - i - 1 ] ) return false ; return true ; } static bool CheckBinaryEquivalent ( int N , String str ) { int B_Number = 0 ; int cnt = 0 ; while ( N != 0 ) { int rem = N % 2 ; int c = ( int ) Math . Pow ( 10 , cnt ) ; B_Number += rem * c ; N /= 2 ; cnt ++ ; } String bin = B_Number . ToString ( ) ; return isSuffix ( str , bin ) ; } public static void Main ( String [ ] args ) { int N = 23 ; String str = "111" ; if ( CheckBinaryEquivalent ( N , str ) ) Console . WriteLine ( " Yes STRNEWLINE " ) ; else Console . WriteLine ( " No STRNEWLINE " ) ; } }

Accumulator variables: B_Number, N, cnt, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static Boolean isvowel ( char ch ) { return ( ch == ' a ' ch == ' e ' ch == ' i ' ch == ' o ' ch == ' u ' ) ; } static Boolean isvalid ( string s ) { int n = s . Length ; for ( int i = 0 ; i < n ; i ++ ) { if ( ! isvowel ( s [ i ] ) ) return false ; } return true ; } static int CountTotal ( string s ) { int ans = 0 ; int n = s . Length ; for ( int i = 0 ; i < n ; i ++ ) { string temp = " " ; for ( int j = i ; j < n ; j ++ ) { temp += s [ j ] ; if ( isvalid ( temp ) ) ans += 1 ; } } return ans ; } public static void Main ( ) { string s = " aeoibsddaaeiouudb " ; Console . Write ( ( CountTotal ( s ) ) + " STRNEWLINE " ) ; } }

Index/key variables: i, j
Accumulator variables: ans, i, j, temp
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isVowel ( char c ) { return ( c == ' a ' c == ' e ' c == ' i ' c == ' o ' c == ' u ' ) ; } static bool isValid ( string s ) { int n = s . Length ; if ( n == 1 ) return ( isVowel ( s [ 0 ] ) ) ; if ( isVowel ( s [ 0 ] ) == false ) return false ; for ( int i = 1 ; i < n ; i ++ ) { if ( s [ i ] == s [ i - 1 ] || ! isVowel ( s [ i ] ) ) return false ; } return true ; } static int findMaxLen ( string s ) { int maxLen = 0 ; int n = s . Length ; for ( int i = 0 ; i < n ; i ++ ) { string temp = " " ; for ( int j = i ; j < n ; j ++ ) { temp = temp + s [ j ] ; if ( isValid ( temp ) ) maxLen = Math . Max ( maxLen , ( j - i + 1 ) ) ; } } return maxLen ; } public static void Main ( ) { string Str = " aeoibsddaeiouudb " ; Console . WriteLine ( findMaxLen ( Str ) ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static void BalancedNumber ( string s ) { int Leftsum = 0 ; int Rightsum = 0 ; for ( int i = 0 ; i < s . Length / 2 ; i ++ ) { Leftsum += ( int ) ( Char . GetNumericValue ( s [ i ] ) - Char . GetNumericValue ( '0' ) ) ; Rightsum += ( int ) ( Char . GetNumericValue ( s [ s . Length - 1 - i ] ) - Char . GetNumericValue ( '0' ) ) ; } if ( Leftsum == Rightsum ) Console . WriteLine ( " Balanced " ) ; else Console . WriteLine ( " Not ▁ Balanced " ) ; } static void Main ( ) { string s = "12321" ; BalancedNumber ( s ) ; } }

Index/key variables: i
Accumulator variables: Leftsum, Rightsum, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int mod = ( int ) ( 1e9 + 7 ) ; static int expo ( int Base , int exponent ) { int ans = 1 ; while ( exponent != 0 ) { if ( ( exponent & 1 ) == 1 ) { ans = ans * Base ; ans = ans % mod ; } Base = Base * Base ; Base %= mod ; exponent >>= 1 ; } return ans % mod ; } static int findCount ( int N ) { int ans = ( expo ( 26 , N ) - expo ( 5 , N ) - expo ( 21 , N ) ) % mod ; ans += mod ; ans %= mod ; return ans ; } public static void Main ( String [ ] args ) { int N = 3 ; Console . Write ( findCount ( N ) ) ; } }

Accumulator variables: ans
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int decompose ( List < int > S ) { Stack < int > s = new Stack < int > ( ) ; int N = S . Count ; int ans = 0 ; int nix = Int32 . MaxValue ; for ( int i = N - 1 ; i >= 0 ; i -- ) { if ( s . Count == 0 ) { s . Push ( S [ i ] ) ; nix = S [ i ] ; } else { if ( S [ i ] < s . Peek ( ) ) { s . Push ( S [ i ] ) ; nix = Math . Min ( nix , S [ i ] ) ; } else { int val = S [ i ] ; while ( s . Count != 0 && val >= s . Peek ( ) ) { s . Pop ( ) ; } nix = Math . Min ( nix , S [ i ] ) ; s . Push ( nix ) ; } } ans += s . Count ; } return ans ; } static void Main ( ) { List < int > S = new List < int > ( ) ; S . Add ( 9 ) ; S . Add ( 6 ) ; S . Add ( 9 ) ; S . Add ( 35 ) ; Console . WriteLine ( decompose ( S ) ) ; } }

Index/key variables: i
Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int maxSetBitCount ( string s , int k ) { int maxCount = 0 , n = s . Length ; int count = 0 ; for ( int i = 0 ; i < k ; i ++ ) { if ( s [ i ] == '1' ) count ++ ; } maxCount = count ; for ( int i = k ; i < n ; i ++ ) { if ( s [ i - k ] == '1' ) count -- ; if ( s [ i ] == '1' ) count ++ ; maxCount = Math . Max ( maxCount , count ) ; } return maxCount ; } public static void Main ( ) { string s = "100111010" ; int k = 3 ; Console . Write ( maxSetBitCount ( s , k ) ) ; } }

Index/key variables: i
Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int minDel ( string s1 , string s2 ) { int i = s1 . Length ; int j = s2 . Length ; while ( i > 0 && j > 0 ) { if ( s1 [ i - 1 ] != s2 [ j - 1 ] ) { break ; } i -- ; j -- ; } return i + j ; } public static void Main ( ) { string s1 = " geeksforgeeks " , s2 = " peeks " ; Console . Write ( minDel ( s1 , s2 ) ) ; } }

Accumulator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int minDel ( String s1 , String s2 ) { int i = 0 ; while ( i < Math . Min ( s1 . Length , s2 . Length ) ) { if ( s1 [ i ] != s2 [ i ] ) { break ; } i ++ ; } int ans = ( ( s1 . Length - i ) + ( s2 . Length - i ) ) ; return ans ; } public static void Main ( String [ ] args ) { String s1 = " geeks " ; String s2 = " geeksfor " ; Console . WriteLine ( minDel ( s1 , s2 ) ) ; } }

Index/key variables: i
Accumulator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void CountValidTriplet ( string s , int n ) { int count_a = 0 , count_b = 0 , count_c = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( s [ i ] == ' a ' ) count_a ++ ; if ( s [ i ] == ' b ' ) count_b ++ ; if ( s [ i ] == ' c ' ) count_c ++ ; } int Total_triplet = count_a * count_b * count_c ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = i + 1 ; j < n ; j ++ ) { if ( ( 2 * j - i ) < n && s [ j ] != s [ i ] && s [ j * 2 - i ] != s [ j ] && s [ 2 * j - i ] != s [ i ] ) Total_triplet -- ; } } Console . Write ( Total_triplet ) ; } public static void Main ( ) { string s = " abcbcabc " ; int n = s . Length ; CountValidTriplet ( s , n ) ; } }

Index/key variables: i, j
Accumulator variables: Total_triplet, count_a, count_b, count_c, i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { public static bool isBalanced ( String exp ) { bool flag = true ; int count = 0 ; for ( int i = 0 ; i < exp . Length ; i ++ ) { if ( exp [ i ] == ' ( ' ) { count ++ ; } else { count -- ; } if ( count < 0 ) { flag = false ; break ; } } if ( count != 0 ) { flag = false ; } return flag ; } public static void Main ( String [ ] args ) { String exp1 = " ( ( ( ) ) ) ( ) ( ) " ; if ( isBalanced ( exp1 ) ) Console . WriteLine ( " Balanced " ) ; else Console . WriteLine ( " Not ▁ Balanced " ) ; String exp2 = " ( ) ) ( ( ( ) ) " ; if ( isBalanced ( exp2 ) ) Console . WriteLine ( " Balanced " ) ; else Console . WriteLine ( " Not ▁ Balanced " ) ; } }

Index/key variables: i
Accumulator variables: count, i
Iterator variables: i
Boolean variables: flag
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void longestPalindrome ( String s ) { int n = s . Length ; int [ , ] pref = new int [ 26 , n ] ; List < int > [ ] pos = new List < int > [ 26 ] ; for ( int i = 0 ; i < pos . Length ; i ++ ) pos [ i ] = new List < int > ( ) ; pref [ s [ 0 ] - ' a ' , 0 ] ++ ; pos [ s [ 0 ] - ' a ' ] . Add ( 0 ) ; for ( int i = 1 ; i < n ; i ++ ) { for ( int j = 0 ; j < 26 ; j ++ ) pref [ j , i ] += pref [ j , i - 1 ] ; int index = s [ i ] - ' a ' ; pref [ index , i ] ++ ; pos [ index ] . Add ( i ) ; } int ans = 0 ; for ( int i = 0 ; i < 26 ; i ++ ) { int size = pos [ i ] . Count ; ans = Math . Max ( ans , size ) ; for ( int j = 0 ; j < size / 2 ; j ++ ) { int l = pos [ i ] [ j ] ; int r = pos [ i ] [ size - j - 1 ] - 1 ; for ( int k = 0 ; k < 26 ; k ++ ) { int sum = pref [ k , r ] - pref [ k , l ] ; ans = Math . Max ( ans , 2 * ( j + 1 ) + sum ) ; } } } Console . Write ( ans + " STRNEWLINE " ) ; } public static void Main ( String [ ] args ) { String S = " bbccdcbb " ; longestPalindrome ( S ) ; } }

Index/key variables: i, index, j
Accumulator variables: i, j, k
Iterator variables: i, j, k
Class/struct names: GFG
C# program:
using System ; class GFG { static bool checkWord ( char [ , ] board , String word , int index , int row , int col ) { if ( row < 0 || col < 0 || row >= board . GetLength ( 0 ) || col >= board . GetLength ( 1 ) ) return false ; if ( board [ row , col ] != word [ index ] ) return false ; else if ( index == word . Length - 1 ) return true ; char temp = board [ row , col ] ; board [ row , col ] = ' * ' ; if ( checkWord ( board , word , index + 1 , row + 1 , col ) || checkWord ( board , word , index + 1 , row - 1 , col ) || checkWord ( board , word , index + 1 , row , col + 1 ) || checkWord ( board , word , index + 1 , row , col - 1 ) ) { board [ row , col ] = temp ; return true ; } board [ row , col ] = temp ; return false ; } public static void Main ( String [ ] args ) { char [ , ] board = { { ' A ' , ' B ' , ' C ' , ' E ' } , { ' S ' , ' F ' , ' C ' , ' S ' } , { ' A ' , ' D ' , ' E ' , ' E ' } } ; String word = " CFDASABCESEE " ; for ( int i = 0 ; i < board . GetLength ( 0 ) ; i ++ ) { for ( int j = 0 ; j < board . GetLength ( 1 ) ; j ++ ) { if ( board [ i , j ] == word [ 0 ] && checkWord ( board , word , 0 , i , j ) ) { Console . WriteLine ( " True " ) ; return ; } } } Console . WriteLine ( " False " ) ; } }

Index/key variables: index
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int count ( String N , int X , String subStr , int index , int n ) { if ( index == n ) return 0 ; String a = subStr + N [ index ] ; int b = 0 ; if ( long . Parse ( a ) % X == 0 ) b = 1 ; int m1 = count ( N , X , a , index + 1 , n ) ; int m2 = b + count ( N , X , " " , index + 1 , n ) ; return Math . Max ( m1 , m2 ) ; } public static void Main ( String [ ] args ) { String N = "00001242" ; int K = 3 ; int l = N . Length ; Console . Write ( count ( N , K , " " , 0 , l ) + " STRNEWLINE " ) ; } }

Index/key variables: index
Class/struct names: GFG
C# program:
using System ; class GFG { public static bool checkSuffix ( int A , int B ) { string s1 = A . ToString ( ) ; string s2 = B . ToString ( ) ; int n1 = s1 . Length ; int n2 = s2 . Length ; if ( n1 < n2 ) { return false ; } for ( int i = 0 ; i < n2 ; i ++ ) { if ( s1 [ n1 - i - 1 ] != s2 [ n2 - i - 1 ] ) { return false ; } } return true ; } public static void Main ( string [ ] args ) { int A = 12345 , B = 45 ; bool result = checkSuffix ( A , B ) ; if ( result ) { Console . Write ( " Yes " ) ; } else { Console . Write ( " No " ) ; } } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void checkSuffix ( int A , int B ) { String s1 = String . Join ( " " , A ) ; String s2 = String . Join ( " " , B ) ; bool result ; result = s1 . EndsWith ( s2 ) ; if ( result ) { Console . Write ( " Yes " ) ; } else { Console . Write ( " No " ) ; } } public static void Main ( String [ ] args ) { int A = 12345 , B = 45 ; checkSuffix ( A , B ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static String build_binary_str ( int p , int q , int r ) { String ans = " " ; if ( q == 0 ) { if ( p != 0 && r != 0 ) { return " - 1" ; } else { if ( p > 0 ) { ans = Strings ( p + 1 , '0' ) ; } else { ans = Strings ( r + 1 , '1' ) ; } } } else { for ( int i = 1 ; i <= q + 1 ; i ++ ) { if ( i % 2 == 0 ) { ans += '0' ; } else { ans += '1' ; } } ans = ans . Substring ( 0 , 1 ) + Strings ( p , '0' ) + ans . Substring ( 1 ) ; ans = Strings ( r , '1' ) + ans ; } return ans ; } static String Strings ( int p , char c ) { String ans = " " ; for ( int i = 0 ; i < p ; i ++ ) ans += c ; return ans ; } public static void Main ( String [ ] args ) { int p = 1 , q = 2 , r = 2 ; Console . Write ( build_binary_str ( p , q , r ) ) ; } }

Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool check ( string s ) { bool ok = true ; for ( int i = 0 ; i + 1 < s . Length ; ++ i ) ok &= ( Math . Abs ( s [ i ] - s [ i + 1 ] ) != 1 ) ; return ok ; } static string monotonousString ( string s ) { string odd = " " , even = " " ; for ( int i = 0 ; i < s . Length ; ++ i ) { if ( s [ i ] % 2 == 0 ) odd += s [ i ] ; else even += s [ i ] ; } char [ ] oddArray = odd . ToCharArray ( ) ; Array . Sort ( oddArray ) ; odd = new String ( oddArray ) ; char [ ] evenArray = even . ToCharArray ( ) ; Array . Sort ( evenArray ) ; even = new String ( evenArray ) ; if ( check ( odd + even ) ) return " Yes " ; else if ( check ( even + odd ) ) return " Yes " ; return " No " ; } public static void Main ( string [ ] args ) { string str = " abcd " ; string ans ; ans = monotonousString ( str ) ; Console . Write ( ans ) ; } }

Index/key variables: i
Accumulator variables: even, odd, ok
Iterator variables: i
Boolean variables: ok
Class/struct names: GFG
C# program:
using System ; class GFG { static int get_index ( char ch ) { if ( ch == ' a ' ) return 0 ; else if ( ch == ' e ' ) return 1 ; else if ( ch == ' i ' ) return 2 ; else if ( ch == ' o ' ) return 3 ; else if ( ch == ' u ' ) return 4 ; else return - 1 ; } static int findMinLength ( String s ) { int n = s . Length ; int ans = n + 1 ; int start = 0 ; int [ ] count = new int [ 5 ] ; for ( int x = 0 ; x < n ; x ++ ) { int idx = get_index ( s [ x ] ) ; if ( idx != - 1 ) { count [ idx ] ++ ; } int idx_start = get_index ( s [ start ] ) ; while ( idx_start == - 1 count [ idx_start ] > 1 ) { if ( idx_start != - 1 ) { count [ idx_start ] -- ; } start ++ ; if ( start < n ) idx_start = get_index ( s [ start ] ) ; } if ( count [ 0 ] > 0 && count [ 1 ] > 0 && count [ 2 ] > 0 && count [ 3 ] > 0 && count [ 4 ] > 0 ) { ans = Math . Min ( ans , x - start + 1 ) ; } } if ( ans == n + 1 ) return - 1 ; return ans ; } public static void Main ( String [ ] args ) { String s = " aaeebbeaccaaoiuooooooooiuu " ; Console . Write ( findMinLength ( s ) ) ; } }

Index/key variables: idx, idx_start, start, x
Accumulator variables: start, x
Iterator variables: x
Class/struct names: GFG
C# program:
using System ; class GFG { static int countStrings ( String s ) { int cnt = 0 ; for ( int i = 1 ; i < s . Length - 1 ; i ++ ) { if ( s [ i ] == s [ i + 1 ] ) { cnt ++ ; } } return cnt ; } public static void Main ( String [ ] args ) { String str = " aacbb " ; Console . WriteLine ( countStrings ( str ) ) ; } }

Index/key variables: i
Accumulator variables: cnt, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool checkValidString ( String str ) { int [ ] freq = new int [ 26 ] ; for ( int i = 0 ; i < str . Length ; i ++ ) { freq [ str [ i ] - ' a ' ] ++ ; } for ( int i = 0 ; i < 26 ; i ++ ) { if ( freq [ i ] != 0 ) { if ( freq [ i ] != i + 1 ) { return false ; } } } return true ; } public static void Main ( String [ ] args ) { String str = " abbcccdddd " ; if ( checkValidString ( str ) ) { Console . Write ( " Yes " ) ; } else { Console . Write ( " No " ) ; } } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void removeRepeating ( string s1 , string s2 ) { string s3 = s1 + " ▁ " + s2 + " ▁ " ; string words = " " ; int i = 0 ; foreach ( char x in s3 . ToCharArray ( ) ) { if ( x == ' ▁ ' ) { if ( ! s1 . Contains ( words ) || ! s2 . Contains ( words ) ) Console . Write ( words ) ; words = " ▁ " ; } else { words = words + x ; } } } public static void Main ( string [ ] args ) { string s1 = " I ▁ have ▁ go ▁ a ▁ pen " ; string s2 = " I ▁ want ▁ to ▁ go ▁ park " ; removeRepeating ( s1 , s2 ) ; } }

Iterator variables: x
Class/struct names: GFG
C# program:
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 ) ; } }

Index/key variables: i
Accumulator variables: i, num, semiPrime, sumOfPrime
Iterator variables: i
Class/struct names: GFG
C# program:
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 ) ; } }

Index/key variables: i
Accumulator variables: count, i, s, sum
Iterator variables: i
Class/struct names: GFG
C# program:
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 ( ) ) ) ; } }

Index/key variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
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 ) ; } }

Accumulator variables: i, j, k
Iterator variables: i, j
Class/struct names: GFG
C# program:
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 ) ; } }

Index/key variables: i, ptr1, ptr2
Accumulator variables: i, ptr1, ptr2
Iterator variables: i
Boolean variables: flag
Class/struct names: GFG
C# program:
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 ) ) ; } }

Index/key variables: i
Accumulator variables: decrypted_str, i, num_found_so_far
Iterator variables: i
Class/struct names: GFG
C# program:
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 ) ; } }

Index/key variables: MAX, i, r1, r2, x
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG, pair
C# program:
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 ) ; } }

Index/key variables: a
Accumulator variables: i, j, result
Iterator variables: i, j
Class/struct names: GFG