dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { static int findSum ( String str ) { String temp = "0" ; int sum = 0 ; for ( int i = 0 ; i < str . Length ; i ++ ) { char ch = str [ i ] ; if ( char . IsDigit ( ch ) ) temp += ch ; else { sum += int . Parse ( temp ) ; temp = "0" ; } } return sum + int . Parse ( temp ) ; } public static void Main ( String [ ] args ) { String str = "12abc20yz68" ; Console . WriteLine ( findSum ( str ) ) ; } }

Index/key variables: i
Accumulator variables: i, sum, temp
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class CountKSubStr { int countkDist ( string str , int k ) { int res = 0 ; int n = str . Length ; int [ ] cnt = new int [ 26 ] ; for ( int i = 0 ; i < n ; i ++ ) { int dist_count = 0 ; Array . Clear ( cnt , 0 , cnt . Length ) ; for ( int j = i ; j < n ; j ++ ) { if ( cnt [ str [ j ] - ' a ' ] == 0 ) dist_count ++ ; cnt [ str [ j ] - ' a ' ] ++ ; if ( dist_count == k ) res ++ ; } } return res ; } public static void Main ( ) { CountKSubStr ob = new CountKSubStr ( ) ; string ch = " abcbaa " ; int k = 3 ; Console . Write ( " Total ▁ substrings ▁ with ▁ exactly ▁ " + k + " ▁ distinct ▁ characters ▁ : ▁ " + ob . countkDist ( ch , k ) ) ; } }

Index/key variables: j
Accumulator variables: dist_count, i, j, res
Iterator variables: i, j
Class/struct names: CountKSubStr
C# program:
using System ; class GFG { static String to_upper ( char [ ] In ) { for ( int i = 0 ; i < In . Length ; i ++ ) { if ( ' a ' <= In [ i ] & In [ i ] <= ' z ' ) { In [ i ] = ( char ) ( In [ i ] - ' a ' + ' A ' ) ; } } return String . Join ( " " , In ) ; } public static void Main ( ) { String str = " geeksforgeeks " ; Console . WriteLine ( to_upper ( str . ToCharArray ( ) ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int findMinLength ( String [ ] arr , int n ) { int min = arr [ 0 ] . Length ; for ( int i = 1 ; i < n ; i ++ ) { if ( arr [ i ] . Length < min ) { min = arr [ i ] . Length ; } } return ( min ) ; } static String commonPrefix ( String [ ] arr , int n ) { int minlen = findMinLength ( arr , n ) ; String result = " " ; for ( int i = 0 ; i < minlen ; i ++ ) { current = arr [ 0 ] [ i ] ; for ( int j = 1 ; j < n ; j ++ ) { if ( arr [ j ] [ i ] != current ) { return result ; } } result += ( current ) ; } return ( result ) ; } public static void Main ( String [ ] args ) { String [ ] arr = { " geeksforgeeks " , " geeks " , " geek " , " geezer " } ; int n = arr . Length ; String ans = commonPrefix ( arr , n ) ; if ( ans . Length > 0 ) { Console . WriteLine ( " The ▁ longest ▁ common ▁ prefix ▁ is ▁ " + ans ) ; } else { Console . WriteLine ( " There ▁ is ▁ no ▁ common ▁ prefix " ) ; } } }

Index/key variables: i, j
Accumulator variables: i, j, result
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static void printZigZagConcat ( string str , int n ) { if ( n == 1 ) { Console . Write ( str ) ; return ; } char [ ] str1 = str . ToCharArray ( ) ; int len = str . Length ; string [ ] arr = new string [ n ] ; int row = 0 ; bool down = true ; for ( int i = 0 ; i < len ; ++ i ) { arr [ row ] += ( str1 [ i ] ) ; if ( row == n - 1 ) down = false ; else if ( row == 0 ) down = true ; if ( down ) row ++ ; else row -- ; } for ( int i = 0 ; i < n ; ++ i ) Console . Write ( arr [ i ] ) ; } public static void Main ( ) { String str = " GEEKSFORGEEKS " ; int n = 3 ; printZigZagConcat ( str , n ) ; } }

Index/key variables: i, n, row
Accumulator variables: row
Iterator variables: i
Boolean variables: down
Class/struct names: GFG
C# program:
using System ; using System . Text ; class GFG { static bool isPalin ( char [ ] str , int st , int end ) { while ( st < end ) { if ( str [ st ] != str [ end ] ) return false ; st ++ ; end -- ; } return true ; } static int findMinInsert ( char [ ] str , int n ) { for ( int i = n - 1 ; i >= 0 ; i -- ) { if ( isPalin ( str , 0 , i ) ) return ( n - i - 1 ) ; } return 0 ; } public static void Main ( string [ ] args ) { char [ ] Input = " JAVA " . ToCharArray ( ) ; Console . Write ( findMinInsert ( Input , Input . Length ) ) ; } }

Index/key variables: end, st
Accumulator variables: end, i, st
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static long removeRecur ( long n ) { long prev_digit = n % 10 ; long pow = 10 ; long res = prev_digit ; while ( n > 0 ) { long curr_digit = n % 10 ; if ( curr_digit != prev_digit ) { res += curr_digit * pow ; prev_digit = curr_digit ; pow *= 10 ; } n = n / 10 ; } return res ; } public static void Main ( ) { long n = 12224 ; Console . WriteLine ( removeRecur ( n ) ) ; } }

Accumulator variables: pow, res
Class/struct names: GFG
C# program:
using System ; class GfG { static void stringFilter ( char [ ] str ) { int n = str . Length ; int i = - 1 ; int j = 0 ; while ( j < n ) { if ( j < n - 1 && str [ j ] == ' a ' && str [ j + 1 ] == ' c ' ) j += 2 ; else if ( str [ j ] == ' b ' ) j ++ ; else if ( i >= 0 && str [ j ] == ' c ' && str [ i ] == ' a ' ) { i -- ; j ++ ; } else str [ ++ i ] = str [ j ++ ] ; } Console . WriteLine ( new String ( str ) ) ; } public static void Main ( ) { String str1 = " ad " ; stringFilter ( str1 . ToCharArray ( ) ) ; String str2 = " acbac " ; stringFilter ( str2 . ToCharArray ( ) ) ; String str3 = " aaac " ; stringFilter ( str3 . ToCharArray ( ) ) ; String str4 = " react " ; stringFilter ( str4 . ToCharArray ( ) ) ; String str5 = " aa " ; stringFilter ( str5 . ToCharArray ( ) ) ; String str6 = " ababaac " ; stringFilter ( str6 . ToCharArray ( ) ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Class/struct names: GfG
C# program:
using System ; class GFG { static int myAtoi ( char [ ] str ) { int sign = 1 , Base = 0 , i = 0 ; while ( str [ i ] == ' ▁ ' ) { i ++ ; } if ( str [ i ] == ' - ' str [ i ] == ' + ' ) { sign = 1 - 2 * ( str [ i ++ ] == ' - ' ? 1 : 0 ) ; } while ( i < str . Length && str [ i ] >= '0' && str [ i ] <= '9' ) { if ( Base > int . MaxValue / 10 || ( Base == int . MaxValue / 10 && str [ i ] - '0' > 7 ) ) { if ( sign == 1 ) return int . MaxValue ; else return int . MinValue ; } Base = 10 * Base + ( str [ i ++ ] - '0' ) ; } return Base * sign ; } public static void Main ( String [ ] args ) { char [ ] str = " ▁ - 123" . ToCharArray ( ) ; int val = myAtoi ( str ) ; Console . Write ( " { 0 } ▁ " , val ) ; } }

Index/key variables: i
Accumulator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int NO_OF_CHARS = 256 ; static bool areAnagram ( char [ ] str1 , char [ ] str2 ) { int [ ] count = new int [ NO_OF_CHARS ] ; int i ; for ( i = 0 ; i < str1 . Length ; i ++ ) { count [ str1 [ i ] - ' a ' ] ++ ; count [ str2 [ i ] - ' a ' ] -- ; } if ( str1 . Length != str2 . Length ) return false ; for ( i = 0 ; i < NO_OF_CHARS ; i ++ ) if ( count [ i ] != 0 ) { return false ; } return true ; } public static void Main ( String [ ] args ) { char [ ] str1 = " geeksforgeeks " . ToCharArray ( ) ; char [ ] str2 = " forgeeksgeeks " . ToCharArray ( ) ; if ( areAnagram ( str1 , str2 ) ) Console . Write ( " The ▁ two ▁ strings ▁ are ▁ " + " anagram ▁ of ▁ each ▁ other " ) ; else Console . Write ( " The ▁ two ▁ strings ▁ are ▁ " + " not ▁ anagram ▁ of ▁ each ▁ other " ) ; } }

Index/key variables: NO_OF_CHARS, i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { public static int firstNonRepeating ( string str ) { int [ ] fi = new int [ 256 ] ; for ( int i = 0 ; i < 256 ; i ++ ) fi [ i ] = - 1 ; for ( int i = 0 ; i < str . Length ; i ++ ) { if ( fi [ str [ i ] ] == - 1 ) { fi [ str [ i ] ] = i ; } else { fi [ str [ i ] ] = - 2 ; } } int res = Int32 . MaxValue ; for ( int i = 0 ; i < 256 ; i ++ ) { if ( fi [ i ] >= 0 ) res = Math . Min ( res , fi [ i ] ) ; } if ( res == Int32 . MaxValue ) return - 1 ; else return res ; } public static void Main ( ) { string str ; str = " geeksforgeeks " ; int firstIndex = firstNonRepeating ( str ) ; if ( firstIndex == - 1 ) Console . WriteLine ( " Either ▁ all ▁ characters ▁ are ▁ repeating ▁ or ▁ string ▁ is ▁ empty " ) ; else Console . WriteLine ( " First ▁ non - repeating ▁ character ▁ is ▁ " + str [ firstIndex ] ) ; } }

Index/key variables: firstIndex, i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class IndexOf { public static String unique ( String s ) { String str = " " ; int len = s . Length ; for ( int i = 0 ; i < len ; i ++ ) { char c = s [ i ] ; if ( str . IndexOf ( c ) < 0 ) { str += c ; } } return str ; } public static void Main ( String [ ] args ) { String s = " geeksforgeeks " ; Console . WriteLine ( unique ( s ) ) ; } }

Index/key variables: i
Accumulator variables: i, str
Iterator variables: i
Class/struct names: IndexOf
C# program:
using System ; class GFG { static int isPerfect ( int x ) { int sum_div = 1 ; for ( int i = 2 ; i <= x / 2 ; ++ i ) { if ( x % i == 0 ) { sum_div += i ; } } if ( sum_div == x ) { return 1 ; } else return 0 ; } static void subsetSum ( int [ ] arr , int l , int r , int sum = 0 ) { if ( l > r ) { if ( isPerfect ( sum ) != 0 ) { Console . Write ( sum + " ▁ " ) ; } return ; } subsetSum ( arr , l + 1 , r , sum + arr [ l ] ) ; subsetSum ( arr , l + 1 , r , sum ) ; } static void Main ( ) { int [ ] arr = { 5 , 4 , 6 } ; int N = arr . Length ; subsetSum ( arr , 0 , N - 1 ) ; } }

Index/key variables: l
Accumulator variables: sum_div
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void PartitionSub ( int [ ] arr , int i , int N , int K , int nos , List < List < int > > v ) { if ( i >= N ) { if ( nos == K ) { for ( int x = 0 ; x < v . Count ; x ++ ) { Console . Write ( " { ▁ " ) ; for ( int y = 0 ; y < v [ x ] . Count ; y ++ ) { Console . Write ( v [ x ] [ y ] ) ; if ( y == v [ x ] . Count - 1 ) { Console . Write ( " ▁ " ) ; } else { Console . Write ( " , ▁ " ) ; } } if ( x == v . Count - 1 ) { Console . Write ( " } " ) ; } else { Console . Write ( " } , ▁ " ) ; } } Console . Write ( " STRNEWLINE " ) ; } return ; } for ( int j = 0 ; j < K ; j ++ ) { if ( v [ j ] . Count > 0 ) { v [ j ] . Add ( arr [ i ] ) ; PartitionSub ( arr , i + 1 , N , K , nos , v ) ; v [ j ] . RemoveAt ( v [ j ] . Count - 1 ) ; } else { v [ j ] . Add ( arr [ i ] ) ; PartitionSub ( arr , i + 1 , N , K , nos + 1 , v ) ; v [ j ] . RemoveAt ( v [ j ] . Count - 1 ) ; break ; } } } static void partKSubsets ( int [ ] arr , int N , int K ) { List < List < int > > v = new List < List < int > > ( ) ; for ( int i = 0 ; i < K ; i ++ ) v . Add ( new List < int > ( ) ) ; if ( K == 0 K > N ) { Console . WriteLine ( " Not ▁ Possible " ) ; } else { Console . WriteLine ( " The ▁ Subset ▁ Combinations ▁ are : ▁ " ) ; PartitionSub ( arr , 0 , N , K , 0 , v ) ; } } public static void Main ( ) { int [ ] arr = { 1 , 2 , 3 , 4 } ; int K = 2 ; int N = arr . Length ; partKSubsets ( arr , N , K ) ; } }

Index/key variables: i, j, x, y
Accumulator variables: i, j, x, y
Iterator variables: i, j, x, y
Class/struct names: GFG
C# program:
using System ; class GFG { static readonly int MAX = 100 ; static int [ ] store = new int [ MAX ] ; static int n ; static int [ , ] graph = new int [ MAX , MAX ] ; static int [ ] d = new int [ MAX ] ; static int ans ; static void SieveOfEratosthenes ( bool [ ] prime , int p_size ) { prime [ 0 ] = false ; prime [ 1 ] = false ; for ( int p = 2 ; p * p <= p_size ; p ++ ) { if ( prime [ p ] ) { for ( int i = p * 2 ; i <= p_size ; i += p ) prime [ i ] = false ; } } } static bool is_clique ( int b ) { for ( int i = 1 ; i < b ; i ++ ) { for ( int j = i + 1 ; j < b ; j ++ ) if ( graph [ store [ i ] , store [ j ] ] == 0 ) return false ; } return true ; } static void primeCliques ( int i , int l , bool [ ] prime ) { for ( int j = i + 1 ; j <= n ; j ++ ) { store [ l ] = j ; if ( is_clique ( l + 1 ) ) { if ( prime [ l ] ) ans ++ ; primeCliques ( j , l + 1 , prime ) ; } } } public static void Main ( String [ ] args ) { int [ , ] edges = { { 1 , 2 } , { 2 , 3 } , { 3 , 1 } , { 4 , 3 } , { 4 , 5 } , { 5 , 3 } } ; int size = edges . GetLength ( 0 ) ; n = 5 ; bool [ ] prime = new bool [ n + 1 ] ; for ( int i = 0 ; i < prime . Length ; i ++ ) prime [ i ] = true ; SieveOfEratosthenes ( prime , n ) ; for ( int i = 0 ; i < size ; i ++ ) { graph [ edges [ i , 0 ] , edges [ i , 1 ] ] = 1 ; graph [ edges [ i , 1 ] , edges [ i , 0 ] ] = 1 ; d [ edges [ i , 0 ] ] ++ ; d [ edges [ i , 1 ] ] ++ ; } ans = 0 ; primeCliques ( 0 , 1 , prime ) ; Console . WriteLine ( ans ) ; } }

Index/key variables: MAX, i, j, l, p
Accumulator variables: ans, i, j, p
Iterator variables: i, j, p
Class/struct names: GFG
C# program:
using System ; class GFG { static int dim = 3 ; public class Node { public int data ; public Node next , prev , up , down ; } ; static Node createNode ( int data ) { Node temp = new Node ( ) ; temp . data = data ; temp . next = null ; temp . prev = null ; temp . up = null ; temp . down = null ; return temp ; } static Node constructDoublyListUtil ( int [ , ] mtrx , int i , int j , Node curr ) { if ( i >= dim j >= dim ) { return null ; } Node temp = createNode ( mtrx [ i , j ] ) ; temp . prev = curr ; temp . up = curr ; temp . next = constructDoublyListUtil ( mtrx , i , j + 1 , temp ) ; temp . down = constructDoublyListUtil ( mtrx , i + 1 , j , temp ) ; return temp ; } static Node constructDoublyList ( int [ , ] mtrx ) { return constructDoublyListUtil ( mtrx , 0 , 0 , null ) ; } static void display ( Node head ) { Node rPtr ; Node dPtr = head ; while ( dPtr != null ) { rPtr = dPtr ; while ( rPtr != null ) { Console . Write ( rPtr . data + " ▁ " ) ; rPtr = rPtr . next ; } Console . Write ( " STRNEWLINE " ) ; dPtr = dPtr . down ; } } public static void Main ( ) { int [ , ] mtrx = { { 1 , 2 , 3 } , { 4 , 5 , 6 } , { 7 , 8 , 9 } } ; Node list = constructDoublyList ( mtrx ) ; display ( list ) ; } }

Class/struct names: GFG, Node
C# program:
using System ; class GFG { public class Node { public int key ; public Node left , right ; } static Node newNode ( int key ) { Node temp = new Node ( ) ; temp . key = key ; temp . left = temp . right = null ; return ( temp ) ; } static int find_x ( int n ) { if ( n == 1 ) return 1 ; double num , den , p ; num = Math . Log10 ( n ) ; int x = 0 , no = 0 ; for ( int i = 2 ; i <= n ; i ++ ) { den = Math . Log10 ( i ) ; p = num / den ; no = ( int ) ( Math . Pow ( i , ( int ) p ) ) ; if ( Math . Abs ( no - n ) < 0.000001 ) { x = i ; break ; } } return x ; } static bool is_key ( int n , int x ) { double p ; p = Math . Log10 ( n ) / Math . Log10 ( x ) ; int no = ( int ) ( Math . Pow ( x , ( int ) p ) ) ; if ( n == no ) return true ; return false ; } static int evenPaths ( Node node , int count , int x ) { if ( node == null || ! is_key ( node . key , x ) ) { return count ; } if ( node . left == null && node . right == null ) { count ++ ; } count = evenPaths ( node . left , count , x ) ; return evenPaths ( node . right , count , x ) ; } static int countExpPaths ( Node node , int x ) { return evenPaths ( node , 0 , x ) ; } public static void Main ( string [ ] args ) { Node root = newNode ( 27 ) ; root . left = newNode ( 9 ) ; root . right = newNode ( 81 ) ; root . left . left = newNode ( 3 ) ; root . left . right = newNode ( 10 ) ; root . right . left = newNode ( 70 ) ; root . right . right = newNode ( 243 ) ; root . right . right . left = newNode ( 81 ) ; root . right . right . right = newNode ( 909 ) ; int x = find_x ( root . key ) ; Console . Write ( countExpPaths ( root , x ) ) ; } }

Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG, Node
C# program:
using System ; using System . Collections . Generic ; class GFG { static int N = 1000001 ; static int c , n , m , a , b ; static void dfs ( int a , int b , List < int > [ ] v , int [ ] vis ) { vis [ a ] = 1 ; c ++ ; foreach ( int i in v [ a ] ) { if ( vis [ i ] == 0 && i != b ) dfs ( i , b , v , vis ) ; } } static void Calculate ( List < int > [ ] v ) { int [ ] vis = new int [ n + 1 ] ; for ( int i = 0 ; i < n + 1 ; i ++ ) vis [ i ] = 0 ; c = 0 ; dfs ( a , b , v , vis ) ; int ans1 = n - c - 1 ; for ( int i = 0 ; i < n + 1 ; i ++ ) vis [ i ] = 0 ; c = 0 ; dfs ( b , a , v , vis ) ; int ans2 = n - c - 1 ; Console . Write ( ans1 * ans2 + " STRNEWLINE " ) ; } public static void Main ( String [ ] args ) { n = 7 ; m = 7 ; a = 3 ; b = 5 ; int [ , ] edges = { { 1 , 2 } , { 2 , 3 } , { 3 , 4 } , { 4 , 5 } , { 5 , 6 } , { 6 , 7 } , { 7 , 5 } } ; List < int > [ ] v = new List < int > [ n + 1 ] ; for ( int i = 0 ; i <= n ; i ++ ) { v [ i ] = new List < int > ( ) ; } for ( int i = 0 ; i < m ; i ++ ) { v [ edges [ i , 0 ] ] . Add ( edges [ i , 1 ] ) ; v [ edges [ i , 1 ] ] . Add ( edges [ i , 0 ] ) ; } Calculate ( v ) ; } }

Index/key variables: a, i
Accumulator variables: c, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int tsp ( int [ , ] graph , bool [ ] v , int currPos , int n , int count , int cost , int ans ) { if ( count == n && graph [ currPos , 0 ] > 0 ) { ans = Math . Min ( ans , cost + graph [ currPos , 0 ] ) ; return ans ; } for ( int i = 0 ; i < n ; i ++ ) { if ( v [ i ] == false && graph [ currPos , i ] > 0 ) { v [ i ] = true ; ans = tsp ( graph , v , i , n , count + 1 , cost + graph [ currPos , i ] , ans ) ; v [ i ] = false ; } } return ans ; } static void Main ( ) { int n = 4 ; int [ , ] graph = { { 0 , 10 , 15 , 20 } , { 10 , 0 , 35 , 25 } , { 15 , 35 , 0 , 30 } , { 20 , 25 , 30 , 0 } } ; bool [ ] v = new bool [ n ] ; v [ 0 ] = true ; int ans = int . MaxValue ; ans = tsp ( graph , v , 0 , n , 1 , 0 , ans ) ; Console . Write ( ans ) ; } }

Index/key variables: i, n
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void printTheArray ( int [ ] arr , int n ) { for ( int i = 0 ; i < n ; i ++ ) { Console . Write ( arr [ i ] + " ▁ " ) ; } Console . WriteLine ( ) ; } static void generateAllBinaryStrings ( int n , int [ ] arr , int i ) { if ( i == n ) { printTheArray ( arr , n ) ; return ; } arr [ i ] = 0 ; generateAllBinaryStrings ( n , arr , i + 1 ) ; arr [ i ] = 1 ; generateAllBinaryStrings ( n , arr , i + 1 ) ; } public static void Main ( String [ ] args ) { int n = 4 ; int [ ] arr = new int [ n ] ; generateAllBinaryStrings ( n , arr , 0 ) ; } }

Index/key variables: i, n
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void printResult ( char [ ] result , int len ) { for ( int i = 0 ; i <= len ; i ++ ) Console . Write ( result [ i ] ) ; Console . WriteLine ( ) ; } static void stringCombination ( char [ ] result , char [ ] str , int [ ] count , int level , int size , int length ) { if ( level == size ) return ; for ( int i = 0 ; i < length ; i ++ ) { if ( count [ i ] == 0 ) continue ; count [ i ] -- ; result [ level ] = str [ i ] ; printResult ( result , level ) ; stringCombination ( result , str , count , level + 1 , size , length ) ; count [ i ] ++ ; } } static void combination ( String str ) { int i ; Dictionary < char , int > mp = new Dictionary < char , int > ( ) ; for ( i = 0 ; i < str . Length ; i ++ ) if ( mp . ContainsKey ( str [ i ] ) ) mp [ str [ i ] ] = mp [ str [ i ] ] + 1 ; else mp . Add ( str [ i ] , 1 ) ; char [ ] input = new char [ mp . Count ] ; int [ ] count = new int [ mp . Count ] ; char [ ] result = new char [ str . Length ] ; i = 0 ; foreach ( KeyValuePair < char , int > entry in mp ) { input [ i ] = entry . Key ; count [ i ] = entry . Value ; i ++ ; } int length = mp . Count ; int size = str . Length ; stringCombination ( result , input , count , 0 , size , length ) ; } public static void Main ( String [ ] args ) { String str = " ABC " ; combination ( str ) ; } }

Index/key variables: i, level
Accumulator variables: i
Iterator variables: entry, i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class Test { static void allCombinationsRec ( List < int > arr , int elem , int n ) { if ( elem > n ) { foreach ( int i in arr ) Console . Write ( i + " ▁ " ) ; Console . WriteLine ( ) ; return ; } for ( int i = 0 ; i < 2 * n ; i ++ ) { if ( arr [ i ] == - 1 && ( i + elem + 1 ) < 2 * n && arr [ i + elem + 1 ] == - 1 ) { arr [ i ] = elem ; arr [ i + elem + 1 ] = elem ; allCombinationsRec ( arr , elem + 1 , n ) ; arr [ i ] = - 1 ; arr [ i + elem + 1 ] = - 1 ; } } } static void allCombinations ( int n ) { List < int > arr = new List < int > ( ) ; for ( int i = 0 ; i < 2 * n ; i ++ ) { arr . Add ( - 1 ) ; } int elem = 1 ; allCombinationsRec ( arr , elem , n ) ; } public static void Main ( string [ ] args ) { int n = 3 ; allCombinations ( n ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: Test
C# program:
using System ; class GFG { static bool fillUtil ( int [ ] res , int curr , int n ) { if ( curr == 0 ) return true ; int i ; for ( i = 0 ; i < 2 * n - curr - 1 ; i ++ ) { if ( res [ i ] == 0 && res [ i + curr + 1 ] == 0 ) { res [ i ] = res [ i + curr + 1 ] = curr ; if ( fillUtil ( res , curr - 1 , n ) ) return true ; res [ i ] = res [ i + curr + 1 ] = 0 ; } } return false ; } static void fill ( int n ) { int [ ] res = new int [ 2 * n ] ; int i ; for ( i = 0 ; i < ( 2 * n ) ; i ++ ) res [ i ] = 0 ; if ( fillUtil ( res , n , n ) ) { for ( i = 0 ; i < 2 * n ; i ++ ) Console . Write ( res [ i ] + " ▁ " ) ; } else Console . Write ( " Not ▁ Possible " ) ; } static public void Main ( ) { fill ( 7 ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections ; using System . Collections . Generic ; class GFG { class node { public int color = 1 ; public HashSet < int > edges = new HashSet < int > ( ) ; } ; static int canPaint ( List < node > nodes , int n , int m ) { List < int > visited = new List < int > ( ) ; for ( int i = 0 ; i < n + 1 ; i ++ ) { visited . Add ( 0 ) ; } int maxColors = 1 ; for ( int sv = 1 ; sv <= n ; sv ++ ) { if ( visited [ sv ] > 0 ) continue ; visited [ sv ] = 1 ; Queue q = new Queue ( ) ; q . Enqueue ( sv ) ; while ( q . Count != 0 ) { int top = ( int ) q . Peek ( ) ; q . Dequeue ( ) ; foreach ( int it in nodes [ top ] . edges ) { if ( nodes [ top ] . color == nodes [ it ] . color ) nodes [ it ] . color += 1 ; maxColors = Math . Max ( maxColors , Math . Max ( nodes [ top ] . color , nodes [ it ] . color ) ) ; if ( maxColors > m ) return 0 ; if ( visited [ it ] == 0 ) { visited [ it ] = 1 ; q . Enqueue ( it ) ; } } } } return 1 ; } public static void Main ( ) { int n = 4 ; int [ , ] graph = { { 0 , 1 , 1 , 1 } , { 1 , 0 , 1 , 0 } , { 1 , 1 , 0 , 1 } , { 1 , 0 , 1 , 0 } } ; List < node > nodes = new List < node > ( ) ; for ( int i = 0 ; i < n + 1 ; i ++ ) { nodes . Add ( new node ( ) ) ; } for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) { if ( graph [ i , j ] > 0 ) { nodes [ i ] . edges . Add ( i ) ; nodes [ j ] . edges . Add ( j ) ; } } } Console . WriteLine ( canPaint ( nodes , n , m ) ) ; } }

Index/key variables: i, it, j, sv, top
Accumulator variables: color, i, j, sv
Iterator variables: i, it, j, sv
Class/struct names: GFG, node
C# program:
using System ; class GFG { static void FastDoubling ( int n , int [ ] res ) { int a , b , c , d ; int MOD = 1000000007 ; if ( n == 0 ) { res [ 0 ] = 0 ; res [ 1 ] = 1 ; return ; } FastDoubling ( ( n / 2 ) , res ) ; a = res [ 0 ] ; b = res [ 1 ] ; c = 2 * b - a ; if ( c < 0 ) c += MOD ; c = ( a * c ) % MOD ; d = ( a * a + b * b ) % MOD ; if ( n % 2 == 0 ) { res [ 0 ] = c ; res [ 1 ] = d ; } else { res [ 0 ] = d ; res [ 1 ] = c + d ; } } public static void Main ( ) { int N = 6 ; int [ ] res = new int [ 2 ] ; FastDoubling ( N , res ) ; Console . Write ( res [ 0 ] ) ; } }

Accumulator variables: c
Class/struct names: GFG