dhyuti-n/xlcost-variable-roles huggingface dataset:
Java program:
public class Node { public Node ( char data , Node next ) { Data = data ; Next = next ; } public char Data ; public Node Next ; } class GFG { private static Node CreateLinkedList ( String s ) { Node header = null ; Node temp = null ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { char c = s . charAt ( i ) ; Node node = new Node ( c , null ) ; if ( header == null ) { header = node ; temp = header ; } else { temp . Next = node ; temp = temp . Next ; } } return header ; } private static Node Reverse ( Node header ) { if ( header == null ) return header ; Node wordStartPosition = null ; Node endOfSentence = null ; Node sentenceStartPosition = null ; wordStartPosition = header ; while ( header != null && header . Data != ' ▁ ' ) { endOfSentence = header ; header = header . Next ; } if ( header == null ) { header = wordStartPosition ; return header ; } do { Node temp = header . Next ; header . Next = wordStartPosition ; wordStartPosition = header ; header = temp ; Node prev = null ; sentenceStartPosition = header ; while ( header != null && header . Data != ' ▁ ' ) { prev = header ; header = header . Next ; } prev . Next = wordStartPosition ; wordStartPosition = sentenceStartPosition ; if ( header == null ) break ; } while ( header != null ) ; header = sentenceStartPosition ; endOfSentence . Next = null ; return header ; } private static void PrintList ( Node Header ) { Node temp = Header ; while ( temp != null ) { System . out . print ( temp . Data ) ; temp = temp . Next ; } } public static void main ( String [ ] args ) { String s = " practice ▁ makes ▁ a ▁ man ▁ perfect " ; Node header = CreateLinkedList ( s ) ; System . out . println ( " Before : " ) ; PrintList ( header ) ; header = Reverse ( header ) ; System . out . println ( " After : "); PrintList ( header ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG, Node
Java program:
class GFG { static int [ ] z_function ( char [ ] s ) { int n = s . length ; int [ ] z = new int [ n ] ; for ( int i = 1 , l = 0 , r = 0 ; i < n ; i ++ ) { if ( i <= r ) z [ i ] = Math . min ( r - i + 1 , z [ i - l ] ) ; while ( i + z [ i ] < n && s [ z [ i ] ] == s [ i + z [ i ] ] ) z [ i ] ++ ; if ( i + z [ i ] - 1 > r ) { l = i ; r = i + z [ i ] - 1 ; } } return z ; } static int n , len = 0 ; static int [ ] bit = new int [ 1000005 ] ; static String s ; static int [ ] z ; static void update ( int idx , int val ) { if ( idx == 0 ) return ; while ( idx <= n ) { bit [ idx ] += val ; idx += ( idx & - idx ) ; } } static int pref ( int idx ) { int ans = 0 ; while ( idx > 0 ) { ans += bit [ idx ] ; idx -= ( idx & - idx ) ; } return ans ; } public static void main ( String [ ] args ) { s = " geeksisforgeeksinplatformgeeks " ; z = new int [ s . length ( ) ] ; n = s . length ( ) ; z = z_function ( s . toCharArray ( ) ) ; for ( int i = 1 ; i < n ; i ++ ) { update ( z [ i ] , 1 ) ; } for ( int i = n - 1 ; i > 1 ; i -- ) { if ( z [ i ] != ( n - i ) ) continue ; if ( pref ( n ) - pref ( z [ i ] - 1 ) >= 2 ) { len = Math . max ( len , z [ i ] ) ; } } if ( len == 0 ) System . out . println ( " - 1" ) ; else System . out . println ( s . substring ( 0 , len ) ) ; } }

Index/key variables: i, idx, n
Accumulator variables: ans, i, idx
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static int endingWith ( String str , String suff ) { int cnt = 0 ; String words [ ] = str . split ( " ▁ " ) ; for ( int i = 0 ; i < words . length ; i ++ ) { if ( words [ i ] . endsWith ( suff ) ) cnt ++ ; } return cnt ; } public static void main ( String args [ ] ) { String str = " GeeksForGeeks ▁ is ▁ a ▁ computer " + " ▁ science ▁ portal ▁ for ▁ geeks " ; String suff = " ks " ; System . out . print ( endingWith ( str , suff ) ) ; } }

Index/key variables: i
Accumulator variables: cnt, i
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static boolean isFrequencyEqual ( String str , int len ) { if ( len % 2 == 1 ) { return false ; } int i , freq [ ] = new int [ 26 ] ; for ( i = 0 ; i < len ; i ++ ) { freq [ str . charAt ( i ) - ' a ' ] ++ ; } for ( i = 0 ; i < 26 ; i ++ ) { if ( freq [ i ] == len / 2 ) { return true ; } } return false ; } public static void main ( String [ ] args ) { String str = " geeksforgeeks " ; int len = str . length ( ) ; if ( isFrequencyEqual ( str , len ) ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static final int MAX = 26 ; static int countMinimalReplacements ( char [ ] s ) { int n = s . length ; int cnt = 0 ; for ( int i = 1 ; i < n ; i ++ ) { if ( s [ i ] == s [ i - 1 ] ) { cnt += 1 ; if ( i != ( n - 1 ) ) { for ( char it : "012" . toCharArray ( ) ) { if ( it != s [ i + 1 ] && it != s [ i - 1 ] ) { s [ i ] = it ; break ; } } } { for ( char it : "012" . toCharArray ( ) ) { if ( it != s [ i - 1 ] ) { s [ i ] = it ; break ; } } } } } return cnt ; } public static void main ( String [ ] args ) { String s = "201220211" ; System . out . println ( countMinimalReplacements ( s . toCharArray ( ) ) ) ; } }

Index/key variables: i
Accumulator variables: cnt, i
Iterator variables: i, it
Class/struct names: GFG
Java program:
public class GFG { static int nextIndex ( String str , int start , char c ) { for ( int i = start ; i < str . length ( ) ; i ++ ) { if ( str . charAt ( i ) == c ) return i ; } return - 1 ; } static int countSubStrings ( String str ) { int i , n = str . length ( ) ; int countX [ ] = new int [ n ] ; int count = 0 ; for ( i = n - 1 ; i >= 0 ; i -- ) { if ( str . charAt ( i ) == ' x ' ) count ++ ; countX [ i ] = count ; } int nextIndexX = nextIndex ( str , 0 , ' x ' ) ; int nextIndexY = nextIndex ( str , 0 , ' y ' ) ; count = 0 ; while ( nextIndexX != - 1 && nextIndexY != - 1 ) { if ( nextIndexX > nextIndexY ) { nextIndexY = nextIndex ( str , nextIndexY + 1 , ' y ' ) ; continue ; } else { count += countX [ nextIndexY ] ; nextIndexX = nextIndex ( str , nextIndexX + 1 , ' x ' ) ; } } return count ; } public static void main ( String [ ] args ) { String s = " xyyxx " ; System . out . println ( countSubStrings ( s ) ) ; } }

Index/key variables: i, n, nextIndexY
Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static boolean isPrime ( int n ) { int i ; if ( n == 1 ) { return false ; } for ( i = 2 ; i <= Math . sqrt ( n ) ; i ++ ) { if ( n % i == 0 ) { return false ; } } return true ; } static boolean check_frequency ( char [ ] s ) { HashMap < Character , Integer > m = new HashMap < Character , Integer > ( ) ; { if ( m . containsKey ( s [ i ] ) ) { m . put ( s [ i ] , m . get ( s [ i ] ) + 1 ) ; } else { m . put ( s [ i ] , 1 ) ; } } for ( char ch = ' a ' ; ch <= ' z ' ; ch ++ ) { if ( m . get ( ch ) != null && m . get ( ch ) > 0 && ! isPrime ( m . get ( ch ) ) ) { return false ; } } return true ; } public static void main ( String [ ] args ) { String s = " geeksforgeeks " ; if ( check_frequency ( s . toCharArray ( ) ) ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } }

Index/key variables: i
Accumulator variables: ch, i
Iterator variables: ch, i
Class/struct names: GFG
Java program:
import java . util . * ; class Solution { static int findSubstringCount ( String str ) { int result = 0 ; int n = str . length ( ) ; for ( int i = 0 ; i < n - 1 ; i ++ ) { if ( str . charAt ( i ) + 1 == str . charAt ( i + 1 ) ) { result ++ ; while ( str . charAt ( i ) + 1 == str . charAt ( i + 1 ) ) { i ++ ; } } } return result ; } public static void main ( String args [ ] ) { String str = " alphabet " ; System . out . println ( findSubstringCount ( str ) ) ; } }

Accumulator variables: i, result
Iterator variables: i
Class/struct names: Solution
Java program:
import java . util . * ; class GFG { public static String reduced_String ( int k , String s ) { if ( k == 1 ) { String ans = " " ; return ans ; } Stack < Pair > st = new Stack < Pair > ( ) ; int l = s . length ( ) ; int ctr = 0 ; for ( int i = 0 ; i < l ; i ++ ) { if ( st . size ( ) == 0 ) { st . push ( new Pair ( s . charAt ( i ) , 1 ) ) ; continue ; } if ( st . peek ( ) . c == s . charAt ( i ) ) { Pair p = st . peek ( ) ; st . pop ( ) ; p . ctr += 1 ; if ( p . ctr == k ) { continue ; } else { st . push ( p ) ; } } else { st . push ( new Pair ( s . charAt ( i ) , 1 ) ) ; } } String ans = " " ; while ( st . size ( ) > 0 ) { char c = st . peek ( ) . c ; int cnt = st . peek ( ) . ctr ; while ( cnt -- > 0 ) ans = c + ans ; st . pop ( ) ; } return ans ; } public static void main ( String [ ] args ) { int k = 2 ; String st = " geeksforgeeks " ; String ans = reduced_String ( k , st ) ; System . out . println ( ans ) ; } static class Pair { char c ; int ctr ; Pair ( char c , int ctr ) { this . c = c ; this . ctr = ctr ; } } }

Accumulator variables: cnt, ctr, i
Iterator variables: i
Class/struct names: GFG, Pair
Java program:
import java . io . * ; import java . util . * ; import java . lang . * ; class GFG { static int firstNonRepeating ( String str ) { int NO_OF_CHARS = 256 ; int arr [ ] = new int [ NO_OF_CHARS ] ; for ( int i = 0 ; i < NO_OF_CHARS ; i ++ ) arr [ i ] = - 1 ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { if ( arr [ str . charAt ( i ) ] == - 1 ) arr [ str . charAt ( i ) ] = i ; else arr [ str . charAt ( i ) ] = - 2 ; } int res = Integer . MAX_VALUE ; for ( int i = 0 ; i < NO_OF_CHARS ; i ++ ) if ( arr [ i ] >= 0 ) res = Math . min ( res , arr [ i ] ) ; return res ; } public static void main ( String args [ ] ) { String str = " geeksforgeeks " ; int index = firstNonRepeating ( str ) ; if ( index == Integer . MAX_VALUE ) System . out . print ( " Either ▁ all ▁ characters ▁ are ▁ " + " repeating ▁ or ▁ string ▁ is ▁ empty " ) ; else System . out . print ( " First ▁ non - repeating ▁ character " + " ▁ is ▁ " + str . charAt ( index ) ) ; } }

Index/key variables: NO_OF_CHARS, i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static String minimize ( String str ) { String mstr = " ▁ " ; int l , i , flagchar [ ] = new int [ 26 ] ; char ch ; l = str . length ( ) ; for ( i = 0 ; i < str . length ( ) ; i ++ ) { ch = str . charAt ( i ) ; if ( flagchar [ ch - 97 ] == 0 ) { mstr = mstr + ch ; flagchar [ ch - 97 ] = 1 ; } } } static void replaceMinimizeUtil ( String str ) { String minimizedStr , finalStr = " " ; int i , index , l ; char ch ; l = str . length ( ) ; for ( i = 0 ; i < minimizedStr . length ( ) ; i ++ ) { ch = minimizedStr . charAt ( i ) ; index = ( ch * ch ) % l ; finalStr = finalStr + str . charAt ( index ) ; } System . out . println ( " Final ▁ String : ▁ " + finalStr ) ; } public static void main ( String [ ] args ) { String str = " geeks " ; replaceMinimizeUtil ( str ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
class LatinCipher { static void cipher ( String str ) { for ( int i = 0 ; i < str . length ( ) ; i ++ ) { if ( ! Character . isLetter ( str . charAt ( i ) ) && str . charAt ( i ) != ' ▁ ' ) { System . out . println ( " Enter ▁ only ▁ alphabets ▁ and ▁ space " ) ; return ; } } System . out . println ( " Encrypted ▁ Code ▁ using ▁ Latin ▁ Alphabet " ) ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { if ( str . charAt ( i ) >= ' A ' && str . charAt ( i ) <= ' Z ' ) { System . out . print ( str . charAt ( i ) - ' A ' + 1 + " ▁ " ) ; } else if ( str . charAt ( i ) >= ' a ' && str . charAt ( i ) <= ' z ' ) { System . out . print ( str . charAt ( i ) - ' a ' + 1 + " ▁ " ) ; } if ( str . charAt ( i ) == ' ▁ ' ) System . out . print ( str . charAt ( i ) ) ; } System . out . println ( ) ; } public static void main ( String [ ] args ) { String str = " geeksforgeeks " ; cipher ( str ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: LatinCipher
Java program:
class GFG { static boolean checkPalin ( String word ) { int n = word . length ( ) ; word = word . toLowerCase ( ) ; for ( int i = 0 ; i < n ; i ++ , n -- ) if ( word . charAt ( i ) != word . charAt ( n - 1 ) ) return false ; return true ; } static int countPalin ( String str ) { str = str + " ▁ " ; String word = " " ; int count = 0 ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { char ch = str . charAt ( i ) ; if ( ch != ' ▁ ' ) word = word + ch ; else { if ( checkPalin ( word ) ) count ++ ; word = " " ; } } return count ; } public static void main ( String args [ ] ) { System . out . println ( countPalin ( " Madam ▁ " + " Arora ▁ teaches ▁ malayalam " ) ) ; System . out . println ( countPalin ( " Nitin ▁ " + " speaks ▁ malayalam " ) ) ; } }

Accumulator variables: count, i, n
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class rtf { public static int n ; public static String z ; public static String s [ ] = new String [ 100 ] ; public static char w [ ] ; public static char letter ; public static boolean pre [ ] = new boolean [ 100 ] ; public static void verify ( int position , int index ) { int l = z . length ( ) ; int k = s [ index ] . length ( ) ; if ( position + k > l ) return ; boolean same = true ; for ( int i = position ; i < position + k ; i ++ ) { int n , n1 ; char ch = w [ i ] ; char ch1 = s [ index ] . charAt ( i - position ) ; if ( ch >= ' a ' && ch <= ' z ' ) n = ch - ' a ' ; else n = ch - ' A ' ; if ( ch1 >= ' a ' && ch1 <= ' z ' ) n1 = ch1 - ' a ' ; else n1 = ch1 - ' A ' ; if ( n != n1 ) same = false ; } if ( same == true ) { for ( int i = position ; i < position + k ; i ++ ) pre [ i ] = true ; return ; } } public static void solve ( ) { w = z . toCharArray ( ) ; letter = ' d ' ; int l = z . length ( ) ; int p = letter - ' a ' ; for ( int i = 0 ; i < 100 ; i ++ ) pre [ i ] = false ; for ( int i = 0 ; i < l ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) verify ( i , j ) ; } for ( int i = 0 ; i < l ; i ++ ) { if ( pre [ i ] == true ) { if ( w [ i ] == letter ) w [ i ] = ( letter == ' a ' ) ? ' b ' : ' a ' ; else if ( w [ i ] == ( char ) ( ( int ) ' A ' + p ) ) w [ i ] = ( letter == ' a ' ) ? ' B ' : ' A ' ; else if ( w [ i ] >= ' a ' && w [ i ] <= ' z ' ) w [ i ] = letter ; else if ( w [ i ] >= ' A ' && w [ i ] <= ' Z ' ) w [ i ] = ( char ) ( ( int ) ' A ' + p ) ; } } System . out . println ( w ) ; } public static void main ( String args [ ] ) { n = 3 ; s [ 0 ] = " etr " ; s [ 1 ] = " ed " ; s [ 2 ] = " ied " ; z = " PEtrUnited " ; solve ( ) ; } }

Index/key variables: i, index
Accumulator variables: i, j
Iterator variables: i, j
Boolean variables: same
Class/struct names: rtf
Java program:
import java . util . * ; class GFG { static int round ( int n ) { int a = ( n / 10 ) * 10 ; int b = a + 10 ; return ( n - a > b - n ) ? b : a ; } public static void main ( String [ ] args ) { int n = 4722 ; System . out . println ( round ( n ) ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static int calculate ( String N ) { int len = N . length ( ) ; int l = ( len ) / 2 ; int count = 0 ; for ( int i = 1 ; i <= l ; i ++ ) { String s = N . substring ( 0 , i ) ; int l1 = s . length ( ) ; String t = N . substring ( i , l1 + i ) ; if ( s . charAt ( 0 ) == '0' || t . charAt ( 0 ) == '0' ) continue ; if ( s . compareTo ( t ) == 0 ) count ++ ; } return count ; } public static void main ( String [ ] args ) { String N = "2202200" ; System . out . print ( calculate ( N ) ) ; } }

Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int countOccurrences ( String s , int K ) { int n = s . length ( ) ; int C = 0 , c1 = 0 , c2 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( s . charAt ( i ) == ' a ' ) c1 ++ ; if ( s . charAt ( i ) == ' b ' ) { c2 ++ ; C += c1 ; } } return C * K + ( K * ( K - 1 ) / 2 ) * c1 * c2 ; } public static void main ( String [ ] args ) { String S = " abcb " ; int k = 2 ; System . out . println ( countOccurrences ( S , k ) ) ; } }

Accumulator variables: C, c1, c2, i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; import java . util . * ; class GFG { public static void printStrongNess ( String input ) { int n = input . length ( ) ; boolean hasLower = false , hasUpper = false , hasDigit = false , specialChar = false ; Set < Character > set = new HashSet < Character > ( Arrays . asList ( ' ! ' , ' @ ' , ' # ' , ' $ ' , ' % ' , ' ^ ' , ' & ' , ' * ' , ' ( ' , ' ) ' , ' - ' , ' + ' ) ) ; for ( char i : input . toCharArray ( ) ) { if ( Character . isLowerCase ( i ) ) hasLower = true ; if ( Character . isUpperCase ( i ) ) hasUpper = true ; if ( Character . isDigit ( i ) ) hasDigit = true ; if ( set . contains ( i ) ) specialChar = true ; } System . out . print ( " Strength ▁ of ▁ password : - ▁ " ) ; if ( hasDigit && hasLower && hasUpper && specialChar && ( n >= 8 ) ) System . out . print ( " ▁ Strong " ) ; else if ( ( hasLower hasUpper specialChar ) && ( n >= 6 ) ) System . out . print ( " ▁ Moderate " ) ; else System . out . print ( " ▁ Weak " ) ; } public static void main ( String [ ] args ) { String input = " GeeksforGeeks ! @12" ; printStrongNess ( input ) ; } }

Iterator variables: i
Boolean variables: hasDigit, hasLower, hasUpper, specialChar
Class/struct names: GFG
Java program:
import java . io . * ; public class GFG { static String findString ( int n , int k ) { String res = " " ; for ( int i = 0 ; i < k ; i ++ ) res = res + ( char ) ( ' a ' + i ) ; int count = 0 ; for ( int i = 0 ; i < n - k ; i ++ ) { res = res + ( char ) ( ' a ' + count ) ; count ++ ; if ( count == k ) count = 0 ; } return res ; } static public void main ( String [ ] args ) { int n = 5 , k = 2 ; System . out . println ( findString ( n , k ) ) ; } }

Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . Scanner ; public class CreditCard { public static void main ( String [ ] args ) { long number = 5196081888500645L ; System . out . println ( number + " ▁ is ▁ " + ( isValid ( number ) ? " valid " : " invalid " ) ) ; } public static boolean isValid ( long number ) { return ( getSize ( number ) >= 13 && getSize ( number ) <= 16 ) && ( prefixMatched ( number , 4 ) || prefixMatched ( number , 5 ) || prefixMatched ( number , 37 ) || prefixMatched ( number , 6 ) ) && ( ( sumOfDoubleEvenPlace ( number ) + sumOfOddPlace ( number ) ) % 10 == 0 ) ; } public static int sumOfDoubleEvenPlace ( long number ) { int sum = 0 ; String num = number + " " ; for ( int i = getSize ( number ) - 2 ; i >= 0 ; i -= 2 ) sum += getDigit ( Integer . parseInt ( num . charAt ( i ) + " " ) * 2 ) ; return sum ; } public static int getDigit ( int number ) { if ( number < 9 ) return number ; return number / 10 + number % 10 ; } public static int sumOfOddPlace ( long number ) { int sum = 0 ; String num = number + " " ; for ( int i = getSize ( number ) - 1 ; i >= 0 ; i -= 2 ) sum += Integer . parseInt ( num . charAt ( i ) + " " ) ; return sum ; } public static boolean prefixMatched ( long number , int d ) { return getPrefix ( number , getSize ( d ) ) == d ; } public static int getSize ( long d ) { String num = d + " " ; return num . length ( ) ; } public static long getPrefix ( long number , int k ) { if ( getSize ( number ) > k ) { String num = number + " " ; return Long . parseLong ( num . substring ( 0 , k ) ) ; } return number ; } }

Accumulator variables: i, sum
Iterator variables: i
Class/struct names: CreditCard
Java program:
import java . util . HashSet ; public class GFG { static boolean isVowel ( char x ) { return ( x == ' a ' x == ' e ' x == ' i ' x == ' o ' x == ' u ' ) ; } static void findSubstring ( String str ) { HashSet < Character > hash = new HashSet < Character > ( ) ; int start = 0 ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { if ( isVowel ( str . charAt ( i ) ) == true ) { hash . add ( str . charAt ( i ) ) ; if ( hash . size ( ) == 5 ) System . out . print ( str . substring ( start , i + 1 ) + " ▁ " ) ; } else { start = i + 1 ; hash . clear ( ) ; } } } public static void main ( String [ ] args ) { String str = " aeoibsddaeiouudb " ; findSubstring ( str ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; import java . lang . * ; import java . io . * ; class gfg { public static String concatenatedString ( String s1 , String s2 ) { String res = " " ; int i ; HashMap < Character , Integer > m = new HashMap < Character , Integer > ( ) ; for ( i = 0 ; i < s2 . length ( ) ; i ++ ) m . put ( s2 . charAt ( i ) , 1 ) ; for ( i = 0 ; i < s1 . length ( ) ; i ++ ) if ( ! m . containsKey ( s1 . charAt ( i ) ) ) res += s1 . charAt ( i ) ; else m . put ( s1 . charAt ( i ) , 2 ) ; for ( i = 0 ; i < s2 . length ( ) ; i ++ ) if ( m . get ( s2 . charAt ( i ) ) == 1 ) res += s2 . charAt ( i ) ; return res ; } public static void main ( String [ ] args ) { String s1 = " abcs " ; String s2 = " cxzca " ; System . out . println ( concatenatedString ( s1 , s2 ) ) ; } }

Accumulator variables: i, res
Iterator variables: i
Class/struct names: gfg
Java program:
public class PalindromeSubstring { static int countPS ( String str ) { String temp = " " ; StringBuffer stf ; int count = 0 ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { for ( int j = i + 1 ; j <= str . length ( ) ; j ++ ) { temp = str . substring ( i , j ) ; if ( temp . length ( ) >= 2 ) { stf = new StringBuffer ( temp ) ; stf . reverse ( ) ; if ( stf . toString ( ) . compareTo ( temp ) == 0 ) count ++ ; } } } return count ; } public static void main ( String args [ ] ) throws Exception { String str = " abbaeae " ; System . out . println ( countPS ( str ) ) ; }

Accumulator variables: count, i, j
Iterator variables: i, j
Class/struct names: PalindromeSubstring
Java program:
import java . util . HashSet ; public class Subsequence { static HashSet < String > st = new HashSet < > ( ) ; static void subsequence ( String str ) { for ( int i = 0 ; i < str . length ( ) ; i ++ ) { if ( isVowel ( str . charAt ( i ) ) ) { for ( int j = ( str . length ( ) - 1 ) ; j >= i ; j -- ) { if ( isConsonant ( str . charAt ( ( j ) ) ) ) { String str_sub = str . substring ( i , j + 1 ) ; st . add ( str_sub ) ; for ( int k = 1 ; k < str_sub . length ( ) - 1 ; k ++ ) { StringBuffer sb = new StringBuffer ( str_sub ) ; sb . deleteCharAt ( k ) ; subsequence ( sb . toString ( ) ) ; } } } } } } static boolean isVowel ( char c ) { return ( c == ' a ' c == ' e ' c == ' i ' c == ' o ' c == ' u ' ) ; } static boolean isConsonant ( char c ) { return ! isVowel ( c ) ; } public static void main ( String [ ] args ) { String s = " xabcef " ; subsequence ( s ) ; System . out . println ( st ) ; } }

Accumulator variables: i, j, k
Iterator variables: i, j, k
Class/struct names: Subsequence
Java program:
class GFG { static String decode ( String str ) { String res = " " ; boolean found = false ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { if ( str . charAt ( i ) == ' ▁ ' ) { found = false ; continue ; } if ( ! found ) { if ( ( str . charAt ( i ) >= ' A ' && str . charAt ( i ) <= ' Z ' ) || ( str . charAt ( i ) >= ' a ' && str . charAt ( i ) <= ' z ' ) ) { res += Character . toString ( str . charAt ( i ) ) ; found = true ; } } } return res . toLowerCase ( ) ; } public static void main ( String [ ] args ) { String in ; in = " A ▁ Step ▁ by ▁ Step ▁ Guide ▁ for ▁ Placement ▁ Preparation ▁ by ▁ GeeksforGeeks " ; System . out . println ( " Enciphered ▁ Message : ▁ " + decode ( in ) ) ; } }

Accumulator variables: i, res
Iterator variables: i
Boolean variables: found
Class/struct names: GFG
Java program:
public class GFG { static int isVowel ( char ch ) { ch = Character . toUpperCase ( ch ) ; if ( ch == ' A ' ch == ' E ' ch == ' I ' ch == ' O ' ch == ' U ' ) return 1 ; else return 0 ; } static int countVowels ( String str , int n ) { if ( n == 1 ) return isVowel ( str . charAt ( n - 1 ) ) ; return countVowels ( str , n - 1 ) + isVowel ( str . charAt ( n - 1 ) ) ; } public static void main ( String args [ ] ) { String str = " abc ▁ de " ; System . out . println ( countVowels ( str , str . length ( ) ) ) ; } }

Class/struct names: GFG