dhyuti-n/xlcost-variable-roles huggingface dataset:
Java program:
import java . util . * ; class GFG { static int fact ( int n ) { int ans = 1 ; for ( int i = 1 ; i <= n ; i ++ ) ans = ans * i ; return ( ans ) ; } static int numberOfPossiblePallindrome ( String str , int n ) { Map < Character , Integer > mp = new HashMap < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) mp . put ( str . charAt ( i ) , mp . get ( str . charAt ( i ) ) == null ? 1 : mp . get ( str . charAt ( i ) ) + 1 ) ; int fi ; for ( Map . Entry < Character , Integer > it : mp . entrySet ( ) ) { if ( it . getValue ( ) % 2 == 0 ) fi = it . getValue ( ) / 2 ; else { fi = ( it . getValue ( ) - 1 ) / 2 ; k ++ ; } num = num + fi ; den = den * fact ( fi ) ; } if ( num != 0 ) num = fact ( num ) ; int ans = num / den ; if ( k != 0 ) { ans = ans * k ; } return ( ans ) ; } public static void main ( String [ ] args ) { String str = " ababab " ; int n = str . length ( ) ; System . out . println ( numberOfPossiblePallindrome ( str , n ) ) ; } }

Accumulator variables: i, k
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int evenDecimalValue ( String str , int n ) { int result = 0 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = i ; j < n ; j ++ ) { int decimalValue = 0 ; int powerOf2 = 1 ; for ( int k = i ; k <= j ; k ++ ) { decimalValue += ( ( str . charAt ( k ) - '0' ) * powerOf2 ) ; powerOf2 *= 2 ; } if ( decimalValue % 2 == 0 ) result ++ ; } } return result ; } public static void main ( String [ ] args ) { String str = "10010" ; int n = 5 ; System . out . println ( evenDecimalValue ( str , n ) ) ; } }

Accumulator variables: decimalValue, i, j, k, powerOf2, result
Iterator variables: i, j, k
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { public static void solve ( String s ) { int l = s . length ( ) ; int x = l / 2 ; int y = l ; String p = " " ; while ( x > 0 && y > l / 2 ) { char ch = s . charAt ( x - 1 ) ; p += ch ; x -- ; ch = s . charAt ( y - 1 ) ; p += ch ; y -- ; } if ( y > l / 2 ) { char ch = s . charAt ( x - 1 ) ; p += ch ; y -- ; } System . out . println ( p ) ; } public static void main ( String args [ ] ) { String s = " sunshine " ; solve ( s ) ; } }

Accumulator variables: p, x, y
Class/struct names: GFG
Java program:
import java . util . * ; public class GFG { private static int recLen ( String str ) { if ( str . equals ( " " ) ) return 0 ; else return recLen ( str . substring ( 1 ) ) + 1 ; } public static void main ( String [ ] args ) { String str = " GeeksforGeeks " ; System . out . println ( recLen ( str ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static boolean isConsonant ( char ch ) { ch = Character . toUpperCase ( ch ) ; return ! ( ch == ' A ' ch == ' E ' ch == ' I ' ch == ' O ' ch == ' U ' ) && ch >= 65 && ch <= 90 ; } static int totalConsonants ( String str ) { int count = 0 ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) if ( isConsonant ( str . charAt ( i ) ) ) ++ count ; return count ; } public static void main ( String args [ ] ) { String str = " abc ▁ de " ; System . out . println ( totalConsonants ( str ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; import java . lang . * ; class GFG { static boolean isConsonant ( char ch ) { ch = Character . toUpperCase ( ch ) ; return ( ch == ' A ' ch == ' E ' ch == ' I ' ch == ' O ' ch == ' U ' ) == false && ch >= 65 && ch <= 90 ; } static int totalConsonants ( String str , int n ) { if ( n == 1 ) { if ( isConsonant ( str . charAt ( 0 ) ) ) return 1 ; else return 0 ; } if ( isConsonant ( str . charAt ( n - 1 ) ) ) return totalConsonants ( str , n - 1 ) + 1 ; else return totalConsonants ( str , n - 1 ) ; } public static void main ( String args [ ] ) { String str = " abc ▁ de " ; System . out . println ( totalConsonants ( str , str . length ( ) ) ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; import java . lang . * ; public class GfG { public static long reverseBits ( long n ) { long rev = 0 ; while ( n > 0 ) { rev <<= 1 ; if ( ( n & 1 ) == 1 ) rev ^= 1 ; n >>= 1 ; } return rev ; } public static boolean isPalindrome ( long n ) { long rev = reverseBits ( n ) ; return ( n == rev ) ; } public static void main ( String argc [ ] ) { long n = 9 ; if ( isPalindrome ( n ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }

Accumulator variables: rev
Class/struct names: GfG
Java program:
import java . util . Arrays ; class GFG { static final int MAX = 26 ; static void Swap ( String s , String t , int n ) { int dp [ ] [ ] = new int [ MAX ] [ MAX ] ; for ( int i = 0 ; i < MAX ; i ++ ) { for ( int j = 0 ; j < MAX ; j ++ ) { dp [ i ] [ j ] = - 1 ; } } int tot = 0 ; for ( int i = 0 ; i < n ; i ++ ) if ( s . charAt ( i ) != t . charAt ( i ) ) tot ++ ; for ( int i = 0 ; i < n ; i ++ ) { int a = s . charAt ( i ) - ' a ' ; int b = t . charAt ( i ) - ' a ' ; if ( a == b ) continue ; if ( dp [ a ] [ b ] != - 1 ) { System . out . println ( i + 1 + " ▁ " + ( dp [ a ] [ b ] + 1 ) ) ; return ; } dp [ b ] [ a ] = i ; } int A [ ] = new int [ MAX ] , B [ ] = new int [ MAX ] ; Arrays . fill ( A , - 1 ) ; Arrays . fill ( B , - 1 ) ; for ( int i = 0 ; i < n ; i ++ ) { int a = s . charAt ( i ) - ' a ' ; int b = t . charAt ( i ) - ' a ' ; if ( a == b ) continue ; if ( A [ b ] != - 1 ) { System . out . println ( i + 1 + " ▁ " + ( A [ b ] + 1 ) ) ; return ; } if ( B [ a ] != - 1 ) { System . out . println ( i + 1 + " ▁ " + ( B [ a ] + 1 ) ) ; return ; } A [ a ] = i ; B [ b ] = i ; } System . out . println ( - 1 ) ; } public static void main ( String [ ] args ) { String S = " permanent " ; String T = " pergament " ; int n = S . length ( ) ; if ( S == " " T == " " ) System . out . println ( " Required ▁ string ▁ is ▁ empty . " ) ; else Swap ( S , T , n ) ; } }

Index/key variables: MAX, a, b, i, j
Accumulator variables: i, j, tot
Iterator variables: i, j
Class/struct names: GFG
Java program:
class GFG { static final int MAX = 26 ; static void printAnagramAndChanges ( char [ ] X , char [ ] Y ) { int countx [ ] = new int [ MAX ] , county [ ] = new int [ MAX ] , ctrx [ ] = new int [ MAX ] , ctry [ ] = new int [ MAX ] ; int change = 0 ; int l = X . length ; for ( int i = 0 ; i < l ; i ++ ) { countx [ X [ i ] - ' A ' ] ++ ; county [ Y [ i ] - ' A ' ] ++ ; } for ( int i = 0 ; i < MAX ; i ++ ) { if ( countx [ i ] > county [ i ] ) { ctrx [ i ] += ( countx [ i ] - county [ i ] ) ; } else if ( countx [ i ] < county [ i ] ) { ctry [ i ] += ( county [ i ] - countx [ i ] ) ; } change += Math . abs ( county [ i ] - countx [ i ] ) ; } for ( int i = 0 ; i < l ; i ++ ) { if ( ctrx [ X [ i ] - ' A ' ] == 0 ) { continue ; } int j ; for ( j = 0 ; j < MAX ; j ++ ) { if ( ( ctry [ j ] ) > 0 ) { break ; } } if ( countx [ X [ i ] - ' A ' ] == ctrx [ X [ i ] - ' A ' ] X [ i ] - ' A ' > j ) { countx [ X [ i ] - ' A ' ] -- ; ctrx [ X [ i ] - ' A ' ] -- ; ctry [ j ] -- ; X [ i ] = ( char ) ( ' A ' + j ) ; } else { countx [ X [ i ] - ' A ' ] -- ; } } System . out . println ( " Anagram ▁ : ▁ " + String . valueOf ( X ) ) ; System . out . println ( " Number ▁ of ▁ changes ▁ made ▁ : ▁ " + change / 2 ) ; } public static void main ( String [ ] args ) { String x = " CDBABC " , y = " ADCABD " ; printAnagramAndChanges ( x . toCharArray ( ) , y . toCharArray ( ) ) ; } }

Index/key variables: MAX, i, j
Accumulator variables: change, i, j
Iterator variables: i, j
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int MAX = 256 ; static int countPairs ( String s ) { int cnt [ ] = new int [ MAX ] ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) cnt [ s . charAt ( i ) ] ++ ; int ans = 0 ; for ( int i = 0 ; i < MAX ; i ++ ) ans += cnt [ i ] * cnt [ i ] ; return ans ; } public static void main ( String [ ] args ) { String s = " geeksforgeeks " ; System . out . println ( countPairs ( s ) ) ; } }

Index/key variables: MAX, i
Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static String lexNext ( String str , int n ) { char [ ] s = str . toCharArray ( ) ; for ( int i = n - 1 ; i >= 0 ; i -- ) { if ( s [ i ] != ' z ' ) { s [ i ] ++ ; return String . valueOf ( s ) ; } s [ i ] = ' a ' ; } return null ; } static public void main ( String [ ] args ) { String S = " abcdeg " , T = " abcfgh " ; int n = S . length ( ) ; String res = lexNext ( S , n ) ; if ( res != T ) { System . out . println ( res ) ; } else { System . out . println ( " - 1" ) ; } } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class Geek { static void solve ( int n , int t , char s [ ] ) { for ( int i = 0 ; i < t ; i ++ ) for ( int j = 0 ; j < n - 1 ; j ++ ) if ( s [ j ] == ' B ' && s [ j + 1 ] == ' G ' ) { char temp = s [ j ] ; s [ j ] = s [ j + 1 ] ; s [ j + 1 ] = temp ; j ++ ; } System . out . print ( s ) ; } public static void main ( String args [ ] ) { int n = 6 , t = 2 ; String s = " BBGBBG " ; char str [ ] = s . toCharArray ( ) ; solve ( n , t , str ) ; } }

Index/key variables: j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: Geek
Java program:
import java . io . * ; class GFG { static int calSumUtil ( int a [ ] , int b [ ] , int n , int m ) { int [ ] sum = new int [ n ] ; int i = n - 1 , j = m - 1 , k = n - 1 ; int carry = 0 , s = 0 ; while ( j >= 0 ) { s = a [ i ] + b [ j ] + carry ; sum [ k ] = ( s % 10 ) ; carry = s / 10 ; k -- ; i -- ; j -- ; } while ( i >= 0 ) { s = a [ i ] + carry ; sum [ k ] = ( s % 10 ) ; carry = s / 10 ; i -- ; k -- ; } int ans = 0 ; if ( carry == 1 ) ans = 10 ; for ( i = 0 ; i <= n - 1 ; i ++ ) { ans += sum [ i ] ; ans *= 10 ; } return ans / 10 ; } static int calSum ( int a [ ] , int b [ ] , int n , int m ) { if ( n >= m ) return calSumUtil ( a , b , n , m ) ; else return calSumUtil ( b , a , m , n ) ; } public static void main ( String [ ] args ) { int a [ ] = { 9 , 3 , 9 } ; int b [ ] = { 6 , 1 } ; int n = a . length ; int m = b . length ; System . out . println ( calSum ( a , b , n , m ) ) ; } }

Index/key variables: i, j, k, n
Accumulator variables: ans, i, j, k
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int SIZE = 26 ; static int longCommomAnagramSubseq ( String str1 , String str2 , int n1 , int n2 ) { int [ ] freq1 = new int [ SIZE ] ; int [ ] freq2 = new int [ SIZE ] ; for ( int i = 0 ; i < SIZE ; i ++ ) { freq1 [ i ] = 0 ; freq2 [ i ] = 0 ; } int len = 0 ; for ( int i = 0 ; i < n1 ; i ++ ) freq1 [ ( int ) str1 . charAt ( i ) - ( int ) ' a ' ] ++ ; for ( int i = 0 ; i < n2 ; i ++ ) freq2 [ ( int ) str2 . charAt ( i ) - ( int ) ' a ' ] ++ ; for ( int i = 0 ; i < SIZE ; i ++ ) len += Math . min ( freq1 [ i ] , freq2 [ i ] ) ; return len ; } public static void main ( String args [ ] ) { String str1 = " abdacp " ; String str2 = " ckamb " ; int n1 = str1 . length ( ) ; int n2 = str2 . length ( ) ; System . out . print ( " Length ▁ = ▁ " + longCommomAnagramSubseq ( str1 , str2 , n1 , n2 ) ) ; } }

Index/key variables: SIZE, i
Accumulator variables: i, len
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static boolean isPanalphabeticWindow ( String s , int n ) { char ch = ' a ' ; for ( int i = 0 ; i < n ; i ++ ) { if ( s . charAt ( i ) == ch ) ch ++ ; if ( ch == ' z ' + 1 ) return true ; } return false ; } public static void main ( String [ ] args ) { String s = " abujm ▁ zvcd ▁ acefc ▁ deghf " + " ▁ gijklem ▁ n ▁ o ▁ p ▁ pafqrstuvwxyzfap " ; int n = s . length ( ) ; if ( isPanalphabeticWindow ( s , n ) ) System . out . print ( " YES " ) ; else System . out . print ( " NO " ) ; } }

Accumulator variables: ch, i
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static boolean isPrime ( int n ) { if ( n <= 1 ) return false ; for ( int i = 2 ; i < n ; i ++ ) if ( n % i == 0 ) return false ; return true ; } static void prime_index ( String input ) { int n = input . length ( ) ; for ( int i = 2 ; i <= n ; i ++ ) if ( isPrime ( i ) ) System . out . print ( input . charAt ( i - 1 ) ) ; } public static void main ( String [ ] args ) { String input = " GeeksforGeeks " ; prime_index ( input ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static boolean isHeterogram ( String s , int n ) { int hash [ ] = new int [ 26 ] ; for ( int i = 0 ; i < n ; i ++ ) { if ( s . charAt ( i ) != ' ▁ ' ) { if ( hash [ s . charAt ( i ) - ' a ' ] == 0 ) hash [ s . charAt ( i ) - ' a ' ] = 1 ; else return false ; } } return true ; } public static void main ( String [ ] args ) { String s = " the ▁ big ▁ dwarf ▁ only ▁ jumps " ; int n = s . length ( ) ; if ( isHeterogram ( s , n ) ) System . out . print ( " YES " ) ; else System . out . print ( " NO " ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; import java . lang . * ; class GeeksforGeeks { static void ASCIISentence ( String str ) { int l = str . length ( ) ; int convert ; for ( int i = 0 ; i < l ; i ++ ) { convert = str . charAt ( i ) ; System . out . print ( convert ) ; } } public static void main ( String args [ ] ) { String str = " GeeksforGeeks " ; System . out . println ( " ASCII ▁ Sentence : " ) ; ASCIISentence ( str ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GeeksforGeeks
Java program:
import java . io . * ; class GFG { static void convert ( String str ) { int n = str . length ( ) ; String str1 = " " ; for ( int i = 0 ; i < n ; i ++ ) { if ( str . charAt ( i ) == ' ▁ ' ) str1 = str1 + ' _ ' ; else str1 = str1 + Character . toLowerCase ( str . charAt ( i ) ) ; } System . out . print ( str1 ) ; } public static void main ( String args [ ] ) { String str = " I ▁ got ▁ intern ▁ at ▁ geeksforgeeks " ; convert ( str ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static int largestAnagramSet ( String arr [ ] , int n ) { int maxSize = 0 ; HashMap < String , Integer > count = new HashMap < > ( ) ; for ( int i = 0 ; i < n ; ++ i ) { char temp [ ] = arr [ i ] . toCharArray ( ) ; Arrays . sort ( temp ) ; arr [ i ] = new String ( temp ) ; if ( count . containsKey ( arr [ i ] ) ) { count . put ( arr [ i ] , count . get ( arr [ i ] ) + 1 ) ; } else { count . put ( arr [ i ] , 1 ) ; } maxSize = Math . max ( maxSize , count . get ( arr [ i ] ) ) ; } return maxSize ; } public static void main ( String [ ] args ) { String arr [ ] = { " ant " , " magenta " , " magnate " , " tan " , " gnamate " } ; int n = arr . length ; System . out . println ( largestAnagramSet ( arr , n ) ) ; String arr1 [ ] = { " cars " , " bikes " , " arcs " , " steer " } ; n = arr1 . length ; System . out . println ( largestAnagramSet ( arr1 , n ) ) ; } }

Index/key variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; public class GFG { static void countCharacterType ( String str ) { int vowels = 0 , consonant = 0 , specialChar = 0 , digit = 0 ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { char ch = str . charAt ( i ) ; if ( ( ch >= ' a ' && ch <= ' z ' ) || ( ch >= ' A ' && ch <= ' Z ' ) ) { ch = Character . toLowerCase ( ch ) ; ; if ( ch == ' a ' ch == ' e ' ch == ' i ' ch == ' o ' ch == ' u ' ) vowels ++ ; else consonant ++ ; } else if ( ch >= '0' && ch <= '9' ) digit ++ ; else specialChar ++ ; } System . out . println ( " Vowels : ▁ " + vowels ) ; System . out . println ( " Consonant : ▁ " + consonant ) ; System . out . println ( " Digit : ▁ " + digit ) ; System . out . println ( " Special ▁ Character : ▁ " + specialChar ) ; } static public void main ( String [ ] args ) { String str = " geeks ▁ for ▁ geeks121" ; countCharacterType ( str ) ; } }

Accumulator variables: consonant, digit, i, specialChar, vowels
Iterator variables: i
Class/struct names: GFG
Java program:
public class GFG { static void findNextWord ( char [ ] s , int m ) { m += 97 ; int n = s . length ; int i = s . length - 1 ; s [ i ] ++ ; while ( i >= 0 && i <= n - 1 ) { if ( s [ i ] >= m ) { s [ i ] = ' a ' ; s [ -- i ] ++ ; } else if ( s [ i ] == s [ i - 1 ] s [ i ] == s [ i - 2 ] ) { s [ i ] ++ ; } else { i ++ ; } } if ( i <= - 1 ) { System . out . println ( " - 1" ) ; } else { System . out . println ( s ) ; } } public static void main ( String [ ] args ) { char [ ] str = " abcd " . toCharArray ( ) ; int k = 4 ; findNextWord ( str , k ) ; } }

Index/key variables: i
Accumulator variables: i, m
Class/struct names: GFG
Java program:
import java . util . * ; import java . lang . * ; class GeeksforGeeks { static int Octal ( int decimal ) { int octal = 0 ; String temp = " " ; while ( decimal > 0 ) { int remainder = decimal % 8 ; temp = remainder + temp ; decimal /= 8 ; } for ( int i = 0 ; i < temp . length ( ) ; i ++ ) octal = ( octal * 10 ) + ( temp . charAt ( i ) - '0' ) ; return octal ; } static String Hexadecimal ( int decimal ) { String hex = " " ; while ( decimal > 0 ) { int remainder = decimal % 16 ; if ( remainder >= 0 && remainder <= 9 ) hex = remainder + hex ; else hex = ( char ) ( ' A ' + remainder % 10 ) + hex ; decimal /= 16 ; } return hex ; } static String HTML ( int decimal ) { String html = " " ; html = html + decimal ; html = " & # " + html + " ; " ; return html ; } static void ASCIIlookuptable ( char ch ) { int decimal = ch ; System . out . println ( " Octal ▁ value : ▁ " + Octal ( decimal ) ) ; System . out . println ( " Decimal ▁ value : ▁ " + decimal ) ; System . out . println ( " Hexadecimal ▁ value : ▁ " + Hexadecimal ( decimal ) ) ; System . out . println ( " HTML ▁ value : ▁ " + HTML ( decimal ) ) ; } public static void main ( String args [ ] ) { char ch = ' @ ' ; ASCIIlookuptable ( ch ) ; } }

Accumulator variables: decimal, i
Iterator variables: i
Class/struct names: GeeksforGeeks
Java program:
class GFG { static String replace ( String s , char c1 , char c2 ) { int l = s . length ( ) ; char [ ] arr = s . toCharArray ( ) ; for ( int i = 0 ; i < l ; i ++ ) { if ( arr [ i ] == c1 ) arr [ i ] = c2 ; else if ( arr [ i ] == c2 ) arr [ i ] = c1 ; } return String . valueOf ( arr ) ; } public static void main ( String [ ] args ) { String s = " grrksfoegrrks " ; char c1 = ' e ' , c2 = ' r ' ; System . out . println ( replace ( s , c1 , c2 ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class Eulerian { public static String fibWord ( int n ) { String Sn_1 = "0" ; String Sn = "01" ; String tmp ; for ( int i = 2 ; i <= n ; i ++ ) { tmp = Sn ; Sn += Sn_1 ; Sn_1 = tmp ; } return Sn ; } public static void main ( String [ ] args ) { int n = 6 ; System . out . print ( fibWord ( n ) ) ; } }

Accumulator variables: Sn, i
Iterator variables: i
Class/struct names: Eulerian
Java program:
import java . util . * ; class GFG { static String decToBin ( int n ) { if ( n == 0 ) return "0" ; String bin = " " ; while ( n > 0 ) { bin = ( ( n & 1 ) == 0 ? '0' : '1' ) + bin ; n >>= 1 ; } return bin ; } static String convertBinToOct ( String bin ) { int l = bin . length ( ) ; for ( int i = 1 ; i <= ( 3 - l % 3 ) % 3 ; i ++ ) bin = '0' + bin ; Map < String , Character > bin_oct_map = new HashMap < > ( ) ; bin_oct_map . put ( "000" , '0' ) ; bin_oct_map . put ( "001" , '1' ) ; bin_oct_map . put ( "010" , '2' ) ; bin_oct_map . put ( "011" , '3' ) ; bin_oct_map . put ( "100" , '4' ) ; bin_oct_map . put ( "101" , '5' ) ; bin_oct_map . put ( "110" , '6' ) ; bin_oct_map . put ( "111" , '7' ) ; int i = 0 ; String octal = " " ; while ( true ) { octal += bin_oct_map . get ( bin . substring ( i , i + 3 ) ) ; i += 3 ; if ( i == bin . length ( ) ) break ; } return octal ; } static String decToOctal ( int n ) { String bin = decToBin ( n ) ; return convertBinToOct ( bin ) ; } public static void main ( String [ ] args ) { int n = 151 ; System . out . println ( decToOctal ( n ) ) ; } }

Accumulator variables: i, octal
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static Vector < String > splitStrings ( String str , char dl ) { String word = " " ; int num = 0 ; str = str + dl ; int l = str . length ( ) ; Vector < String > substr_list = new Vector < String > ( ) ; for ( int i = 0 ; i < l ; i ++ ) { if ( str . charAt ( i ) != dl ) { word = word + str . charAt ( i ) ; } else { if ( ( int ) word . length ( ) != 0 ) { substr_list . add ( word ) ; } word = " " ; } } return substr_list ; } public static void main ( String [ ] args ) { String str = " geeks ; for ; geeks " ; char dl = ' ; ' ; Vector < String > res = splitStrings ( str , dl ) ; for ( String x : res ) { System . out . println ( x ) ; } } }

Accumulator variables: i
Iterator variables: i, x
Class/struct names: GFG
Java program:
class GFG { static String constructPalin ( char [ ] str , int len ) { int i = 0 , j = len - 1 ; for ( ; i < j ; i ++ , j -- ) { if ( str [ i ] == str [ j ] && str [ i ] != ' * ' ) continue ; else if ( str [ i ] == str [ j ] && str [ i ] == ' * ' ) { str [ i ] = ' a ' ; str [ j ] = ' a ' ; continue ; } else if ( str [ i ] == ' * ' ) { str [ i ] = str [ j ] ; continue ; } else if ( str [ j ] == ' * ' ) { str [ j ] = str [ i ] ; continue ; } System . out . println ( " Not ▁ Possible " ) ; return " " ; } return String . valueOf ( str ) ; } public static void main ( String [ ] args ) { String str = " bca * xc * * b " ; int len = str . length ( ) ; System . out . println ( constructPalin ( str . toCharArray ( ) , len ) ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Class/struct names: GFG
Java program:
class GFG { static String conversion ( char charSet [ ] , String str ) { int n = str . length ( ) ; char hashChar [ ] = new char [ 26 ] ; for ( int i = 0 ; i < 26 ; i ++ ) { int ch = Math . abs ( charSet [ i ] - ' a ' ) ; hashChar [ ch ] = ( char ) ( ' a ' + i ) ; } String s = " " ; for ( int i = 0 ; i < n ; i ++ ) { s += hashChar [ str . charAt ( i ) - ' a ' ] ; } return s ; } public static void main ( String [ ] args ) { char charSet [ ] = " qwertyuiopasdfghjklzxcvbnm " . toCharArray ( ) ; String str = " egrt " ; str = conversion ( charSet , str ) ; System . out . println ( str ) ; } }

Index/key variables: ch, i
Accumulator variables: i, s
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static char [ ] alphabets = " abcdefghijklmnopqrstuvwxyz " . toCharArray ( ) ; static String conversion ( String charSet , char [ ] str1 ) { String s2 = " " ; for ( char i : str1 ) s2 += alphabets [ charSet . indexOf ( i ) ] ; return s2 ; } public static void main ( String [ ] args ) { String charSet = " qwertyuiopasdfghjklzxcvbnm " ; String str1 = " egrt " ; System . out . print ( conversion ( charSet , str1 . toCharArray ( ) ) ) ; } }

Accumulator variables: s2
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . HashSet ; class GFG { static int numberOfDifferentSubstrings ( String s , char a , char b ) { int ans = 0 ; int ls = s . length ( ) ; int [ ] x = new int [ ls ] ; int [ ] y = new int [ ls ] ; for ( int i = 0 ; i < ls ; i ++ ) { if ( s . charAt ( i ) == a ) x [ i ] = 1 ; if ( s . charAt ( i ) == b ) y [ i ] = 1 ; } HashSet < String > hash = new HashSet < > ( ) ; String curr_substr = " " ; for ( int i = 0 ; i < ls ; i ++ ) { if ( x [ i ] != 0 ) { for ( int j = i ; j < ls ; j ++ ) { if ( y [ j ] == 0 ) curr_substr += s . charAt ( i ) ; if ( y [ j ] != 0 ) { curr_substr += s . charAt ( j ) ; if ( ! hash . contains ( curr_substr ) ) ans ++ ; hash . add ( curr_substr ) ; } } curr_substr = " " ; } } return ans ; } public static void main ( String [ ] args ) { String s = " codecppforfood " ; char begin = ' c ' ; char end = ' d ' ; System . out . println ( numberOfDifferentSubstrings ( s , begin , end ) ) ; } }

Index/key variables: i, j, ls
Accumulator variables: ans, curr_substr, i, j
Iterator variables: i, j
Class/struct names: GFG