dhyuti-n/xlcost-variable-roles huggingface dataset:
Java program:
import java . util . * ; class GFG { static void subsetDifference ( int n ) { int s = n * ( n + 1 ) / 2 ; if ( n % 4 == 0 ) { System . out . println ( " First ▁ subset ▁ sum ▁ = ▁ " + s / 2 ) ; System . out . println ( " Second ▁ subset ▁ sum ▁ = ▁ " + s / 2 ) ; System . out . println ( " Difference ▁ = ▁ " + 0 ) ; } else { if ( n % 4 == 1 n % 4 == 2 ) { System . out . println ( " First ▁ subset ▁ sum ▁ = ▁ " + s / 2 ) ; System . out . println ( " Second ▁ subset ▁ sum ▁ = ▁ " + ( ( s / 2 ) + 1 ) ) ; System . out . println ( " Difference ▁ = ▁ " + 1 ) ; } else { System . out . println ( " First ▁ subset ▁ sum ▁ = ▁ " + s / 2 ) ; System . out . println ( " Second ▁ subset ▁ sum ▁ = ▁ " + s / 2 ) ; System . out . println ( " Difference ▁ = ▁ " + 0 ) ; } } } public static void main ( String [ ] args ) { int n = 6 ; subsetDifference ( n ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; public class GFG { static void timeToMeet ( double s , double v ) { double V = 3 * v / 2 ; double time = s / V ; System . out . println ( ( float ) time ) ; } static public void main ( String [ ] args ) { double s = 25 , v = 56 ; timeToMeet ( s , v ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static int sumOfTheSeries ( int n ) { int sum = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { int k = 1 ; for ( int j = 1 ; j <= i ; j ++ ) { sum += k ; k += 2 ; } } return sum ; } public static void main ( String [ ] args ) { int n = 5 ; System . out . println ( " Sum ▁ = ▁ " + sumOfTheSeries ( n ) ) ; } }

Accumulator variables: i, j, k, sum
Iterator variables: i, j
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static void checksum ( int n ) { if ( n == 0 ) { System . out . println ( " - 1 ▁ 0 ▁ 1" ) ; return ; } int inc ; if ( n > 0 ) inc = 1 ; else inc = - 1 ; for ( int i = 0 ; i <= n - 2 ; i += inc ) { if ( i + i + 1 + i + 2 == n ) { System . out . println ( i + " ▁ " + ( i + 1 ) + " ▁ " + ( i + 2 ) ) ; return ; } } System . out . println ( " - 1" ) ; } public static void main ( String [ ] args ) { int n = 6 ; checksum ( n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int divisorSum ( int n ) { int sum = 0 ; for ( int i = 1 ; i <= n ; ++ i ) { for ( int j = 1 ; j * j <= i ; ++ j ) { if ( i % j == 0 ) { if ( i / j == j ) sum += j ; else sum += j + i / j ; } } } return sum ; } public static void main ( String args [ ] ) { int n = 4 ; System . out . println ( divisorSum ( n ) ) ; n = 5 ; System . out . println ( divisorSum ( n ) ) ; } }

Accumulator variables: sum
Iterator variables: i, j
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static void printbinomial ( int max ) { for ( int m = 0 ; m <= max ; m ++ ) { System . out . print ( m + " ▁ " ) ; int binom = 1 ; for ( int x = 0 ; x <= m ; x ++ ) { if ( m != 0 && x != 0 ) binom = binom * ( m - x + 1 ) / x ; System . out . print ( binom + " ▁ " ) ; } System . out . println ( ) ; } } public static void main ( String [ ] args ) { int max = 10 ; printbinomial ( max ) ; } }

Accumulator variables: m, x
Iterator variables: m, x
Class/struct names: GFG
Java program:
import java . io . * ; import java . util . * ; class GFG { static long maxPrimeFactors ( long n ) { long maxPrime = - 1 ; while ( n % 2 == 0 ) { maxPrime = 2 ; n >>= 1 ; } while ( n % 3 == 0 ) { maxPrime = 3 ; n = n / 3 ; } for ( int i = 5 ; i <= Math . sqrt ( n ) ; i += 6 ) { while ( n % i == 0 ) { maxPrime = i ; n = n / i ; } while ( n % ( i + 2 ) == 0 ) { maxPrime = i + 2 ; n = n / ( i + 2 ) ; } } if ( n > 4 ) maxPrime = n ; return maxPrime ; } public static void main ( String [ ] args ) { Long n = 15l ; System . out . println ( maxPrimeFactors ( n ) ) ; n = 25698751364526l ; System . out . println ( maxPrimeFactors ( n ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static int countSetBits ( int n ) { int count = 0 ; while ( n > 0 ) { n &= ( n - 1 ) ; count ++ ; } return count ; } static int countUnsetBitsInGivenRange ( int n , int l , int r ) { int num = ( ( 1 << r ) - 1 ) ^ ( ( 1 << ( l - 1 ) ) - 1 ) ; return ( r - l + 1 ) - countSetBits ( n & num ) ; } public static void main ( String [ ] args ) { int n = 80 ; int l = 1 , r = 4 ; System . out . print ( countUnsetBitsInGivenRange ( n , l , r ) ) ; } }

Accumulator variables: count, n
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static String fractionToDecimal ( int numerator , int denominator ) { String res = " " ; HashMap < Integer , Integer > mp = new HashMap < > ( ) ; int rem = numerator % denominator ; while ( ( rem != 0 ) && ! mp . containsKey ( rem ) ) { mp . put ( rem , res . length ( ) ) ; rem = rem * 10 ; int res_part = rem / denominator ; res += res_part + " " ; rem = rem % denominator ; } return ( rem == 0 ) ? " - 1" : res . substring ( mp . get ( rem ) ) ; } static boolean isPrime ( int n ) { for ( int i = 2 ; i <= n / 2 ; i ++ ) if ( n % i == 0 ) return false ; return true ; } static void Midys ( String str , int n ) { int l = str . length ( ) ; int part1 = 0 , part2 = 0 ; if ( ! isPrime ( n ) ) { System . out . print ( " Denominator ▁ is ▁ not ▁ prime , ▁ " + " thus ▁ Midy ' s ▁ theorem ▁ is ▁ not ▁ " + " applicable " ) ; } else if ( l % 2 == 0 ) { for ( int i = 0 ; i < l / 2 ; i ++ ) { part1 = part1 * 10 + ( str . charAt ( i ) - '0' ) ; part2 = part2 * 10 + ( str . charAt ( l / 2 + i ) - '0' ) ; } System . out . println ( part1 + " ▁ + ▁ " + part2 + " ▁ = ▁ " + ( part1 + part2 ) ) ; System . out . print ( " Midy ' s ▁ theorem ▁ holds ! " ) ; } else { System . out . print ( " The ▁ repeating ▁ decimal ▁ is ▁ " + " of ▁ odd ▁ length ▁ thus ▁ Midy ' s ▁ " + " theorem ▁ is ▁ not ▁ applicable " ) ; } } public static void main ( String [ ] args ) { int numr = 2 , denr = 11 ; String res = fractionToDecimal ( numr , denr ) ; if ( res == " - 1" ) System . out . print ( " The ▁ fraction ▁ does ▁ not ▁ " + " have ▁ repeating ▁ decimal " ) ; else { System . out . println ( " Repeating ▁ decimal ▁ = ▁ " + res ) ; Midys ( res , denr ) ; } } }

Accumulator variables: i, res
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static long evenPowerSum ( int n ) { long sum = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { int j = 2 * i ; sum = sum + ( j * j * j * j ) ; } return sum ; } public static void main ( String [ ] args ) { int n = 5 ; System . out . println ( evenPowerSum ( n ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static long evenPowerSum ( int n ) { return ( 8 * n * ( n + 1 ) * ( 2 * n + 1 ) * ( 3 * n * n + 3 * n - 1 ) ) / 15 ; } public static void main ( String [ ] args ) { int n = 4 ; System . out . println ( evenPowerSum ( n ) ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; public class GFG { static int MAX = 501 ; public static int balancedprime ( int n ) { boolean [ ] prime = new boolean [ MAX + 1 ] ; for ( int k = 0 ; k < MAX + 1 ; k ++ ) prime [ k ] = true ; for ( int p = 2 ; p * p <= MAX ; p ++ ) { if ( prime [ p ] == true ) { for ( int i = p * 2 ; i <= MAX ; i += p ) prime [ i ] = false ; } } Vector < Integer > v = new Vector < Integer > ( ) ; for ( int p = 3 ; p <= MAX ; p += 2 ) if ( prime [ p ] ) v . add ( p ) ; int count = 0 ; for ( int i = 1 ; i < v . size ( ) ; i ++ ) { if ( ( int ) v . get ( i ) == ( ( int ) v . get ( i + 1 ) + ( int ) v . get ( i - 1 ) ) / 2 ) count ++ ; if ( count == n ) return ( int ) v . get ( i ) ; } return 1 ; } public static void main ( String [ ] args ) { int n = 4 ; System . out . print ( balancedprime ( n ) ) ; } }

Index/key variables: i, k, p
Accumulator variables: count, i, k, p
Iterator variables: i, k, p
Class/struct names: GFG
Java program:
import java . util . * ; import java . lang . * ; public class GfG { private static final int MAX = 1000001 ; private static final int [ ] factor = new int [ MAX ] ; public static void generatePrimeFactors ( ) { factor [ 1 ] = 1 ; for ( int i = 2 ; i < MAX ; i ++ ) factor [ i ] = i ; for ( int i = 4 ; i < MAX ; i += 2 ) factor [ i ] = 2 ; for ( int i = 3 ; i * i < MAX ; i ++ ) { if ( factor [ i ] == i ) { for ( int j = i * i ; j < MAX ; j += i ) { if ( factor [ j ] == j ) factor [ j ] = i ; } } } } public static int calculateNoOFactors ( int n ) { if ( n == 1 ) return 1 ; int ans = 1 ; int dup = factor [ n ] ; int c = 1 ; int j = n / factor [ n ] ; while ( j != 1 ) { if ( factor [ j ] == dup ) c += 1 ; else { dup = factor [ j ] ; ans = ans * ( c + 1 ) ; c = 1 ; } j = j / factor [ j ] ; } ans = ans * ( c + 1 ) ; return ans ; } public static int smallest ( int n ) { for ( int i = 1 ; ; i ++ ) if ( calculateNoOFactors ( i ) >= n ) return i ; } public static void main ( String args [ ] ) { generatePrimeFactors ( ) ; int n = 4 ; System . out . println ( smallest ( n ) ) ; } }

Index/key variables: MAX, i, j, n
Accumulator variables: c, i, j
Iterator variables: i, j
Class/struct names: GfG
Java program:
import java . io . * ; class GFG { static int squaresum ( int n ) { int sum = 0 ; for ( int i = 1 ; i <= n ; i ++ ) sum += ( i * i ) ; return sum ; } public static void main ( String args [ ] ) throws IOException { int n = 4 ; System . out . println ( squaresum ( n ) ) ; } }

Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static boolean isPrime ( int n ) { int i = 2 ; while ( i * i <= n ) { if ( n % i == 0 ) return false ; i ++ ; } return true ; } static int minimumSum ( int n ) { if ( isPrime ( n ) ) return 1 ; if ( n % 2 == 0 ) return 2 ; if ( isPrime ( n - 2 ) ) return 2 ; return 3 ; } public static void main ( String [ ] args ) { int n = 4 ; System . out . println ( minimumSum ( n ) ) ; } }

Accumulator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; import java . lang . * ; public class GfG { public static int firstDigit ( int n ) { while ( n >= 10 ) n /= 10 ; return n ; } public static int lastDigit ( int n ) { return ( n % 10 ) ; } public static void main ( String argc [ ] ) { int n = 98562 ; System . out . println ( firstDigit ( n ) + " ▁ " + lastDigit ( n ) ) ; } }

Accumulator variables: n
Class/struct names: GfG
Java program:
import java . math . * ; class GFG { static int firstDigit ( int n ) { int digits = ( int ) ( Math . log10 ( n ) ) ; n = ( int ) ( n / ( int ) ( Math . pow ( 10 , digits ) ) ) ; return n ; } static int lastDigit ( int n ) { return ( n % 10 ) ; } public static void main ( String args [ ] ) { int n = 98562 ; System . out . println ( firstDigit ( n ) + " ▁ " + lastDigit ( n ) ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class GFG { public static boolean isPrime ( int x ) { if ( x == 0 x == 1 ) return false ; for ( int i = 2 ; i * i <= x ; ++ i ) if ( x % i == 0 ) return false ; return true ; } public static void findPrimes ( int n ) { System . out . print ( n ) ; System . out . print ( 2 + " ▁ " + ( n - 2 ) ) ; { System . out . print ( 3 + " ▁ " ) ; n = n - 3 ; for ( int i = 0 ; i < n ; i ++ ) { if ( isPrime ( i ) && isPrime ( n - i ) ) { System . out . print ( i + " ▁ " + ( n - i ) ) ; break ; } } } } public static void main ( String [ ] args ) { int n = 27 ; findPrimes ( n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static long c [ ] = new long [ 100 ] ; static void coef ( int n ) { c [ 0 ] = 1 ; for ( int i = 0 ; i < n ; c [ 0 ] = - c [ 0 ] , i ++ ) { c [ 1 + i ] = 1 ; for ( int j = i ; j > 0 ; j -- ) c [ j ] = c [ j - 1 ] - c [ j ] ; } } static boolean isPrime ( int n ) { coef ( n ) ; c [ 0 ] ++ ; c [ n ] -- ; int i = n ; while ( ( i -- ) > 0 && c [ i ] % n == 0 ) ; return i < 0 ; } public static void main ( String [ ] args ) { int n = 37 ; if ( isPrime ( n ) ) System . out . println ( " Prime " ) ; else System . out . println ( " Not ▁ Prime " ) ; } }

Index/key variables: i, j, n
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
Java program:
import java . util . * ; class Digits { public static int motzkin ( int n ) { if ( n == 0 n == 1 ) return 1 ; return ( ( 2 * n + 1 ) * motzkin ( n - 1 ) + ( 3 * n - 3 ) * motzkin ( n - 2 ) ) / ( n + 2 ) ; } public static void main ( String [ ] args ) { int n = 8 ; System . out . print ( motzkin ( n ) ) ; } }

Class/struct names: Digits
Java program:
import java . io . * ; class GFG { static double sumOfSeries ( int n ) { return ( 0.666 ) * ( 1 - 1 / Math . pow ( 10 , n ) ) ; } public static void main ( String [ ] args ) { int n = 2 ; System . out . println ( sumOfSeries ( n ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; import static java . lang . Math . * ; class narcissistic { int countDigit ( int n ) { if ( n == 0 ) return 0 ; return 1 + countDigit ( n / 10 ) ; } boolean check ( int n ) { int l = countDigit ( n ) ; int dup = n ; int sum = 0 ; while ( dup > 0 ) { sum += pow ( dup % 10 , l ) ; dup /= 10 ; } return ( n == sum ) ; } public static void main ( String args [ ] ) { narcissistic obj = new narcissistic ( ) ; int n = 1634 ; if ( obj . check ( n ) ) System . out . println ( " yes " ) ; else System . out . println ( " no " ) ; } }

Accumulator variables: dup, sum
Class/struct names: narcissistic
Java program:
import java . util . * ; import java . lang . * ; class GFG { public static int summation ( int n ) { int sum = 0 ; for ( int i = 1 ; i <= n ; i ++ ) sum += ( i * i ) ; return sum ; } public static void main ( String args [ ] ) { int n = 2 ; System . out . println ( summation ( n ) ) ; } }

Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; import java . lang . * ; public class GFG { private static final int MAX = 0 ; public static void leyland ( int n ) { List < Integer > ans = new ArrayList < Integer > ( ) ; for ( int x = 2 ; x <= n ; x ++ ) { for ( int y = 2 ; y <= x ; y ++ ) { int temp = ( int ) Math . pow ( x , y ) + ( int ) Math . pow ( y , x ) ; ans . add ( temp ) ; } } Collections . sort ( ans ) ; for ( int i = 0 ; i < n ; i ++ ) System . out . print ( ans . get ( i ) + " ▁ " ) ; } public static void main ( String args [ ] ) { int n = 6 ; leyland ( n ) ; } }

Accumulator variables: i, x, y
Iterator variables: i, x, y
Class/struct names: GFG
Java program:
import java . util . Arrays ; import java . util . Collections ; class GFG { public static int kthgroupsum ( int k ) { int cur = ( k * ( k - 1 ) ) + 1 ; int sum = 0 ; while ( k -- > 0 ) { sum += cur ; cur += 2 ; } return sum ; } public static void main ( String [ ] args ) { int k = 3 ; System . out . print ( kthgroupsum ( k ) ) ; } }

Accumulator variables: cur, k, sum
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { public static int nthTerm ( int n ) { return ( n * n ) + ( n * n * n ) ; } public static void main ( String [ ] args ) { int n = 4 ; System . out . print ( nthTerm ( n ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int seriesSum ( int n ) { return ( n * ( n + 1 ) * ( n + 2 ) ) / 6 ; } public static void main ( String [ ] args ) { int n = 4 ; System . out . println ( seriesSum ( n ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static double cal_speed ( double dist , double time ) { System . out . print ( " Distance ( km ) : " + dist) ; System . out . print ( " Time ( hr ) : " + time) ; return dist / time ; } static double cal_dis ( double speed , double time ) { System . out . print ( " Time ( hr ) : " + time) ; System . out . print ( " Speed ( km / hr ) : " + speed) ; return speed * time ; } static double cal_time ( double dist , double speed ) { System . out . print ( " Distance ( km ) : "+ dist) ; System . out . print ( " Speed ( km / hr ) : " + speed) ; return speed * dist ; } public static void main ( String [ ] args ) { System . out . println ( " The calculated Speed ( km / hr ) is : "+ cal_speed ( 45.9 , 2.0 ) ) ; System . out . println ( " The calculated Distance ( km ) : "+ cal_dis ( 62.9 , 2.5 ) ) ; System . out . println ( " The calculated Time ( hr ) : "+ cal_time ( 48.0 , 4.5 ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int term ( int n ) { int ans = 0 ; for ( int i = 1 ; i <= n ; i ++ ) ans += i ; return ans ; } public static void main ( String args [ ] ) { int n = 4 ; System . out . println ( term ( n ) ) ; } }

Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static float avgOfFirstN ( int n ) { return ( float ) ( 1 + n ) / 2 ; } public static void main ( String args [ ] ) { int n = 20 ; System . out . println ( avgOfFirstN ( n ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int summation ( int n ) { int sum ; sum = ( int ) ( Math . pow ( 10 , n + 1 ) - 10 - ( 9 * n ) ) / 81 ; return sum ; } public static void main ( String [ ] args ) { int n = 5 ; System . out . println ( summation ( n ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static double sum ( int x , int n ) { double i , total = 1.0 , multi = x ; for ( i = 1 ; i <= n ; i ++ ) { total = total + multi / i ; multi = multi * x ; } return total ; } public static void main ( String [ ] args ) { int x = 2 ; int n = 5 ; System . out . printf ( " % .2f " , sum ( x , n ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class Series { static int term ( int n ) { int x = ( ( ( 1 ) + ( int ) Math . sqrt ( 1 + ( 8 * n ) ) ) / 2 ) ; return x ; } public static void main ( String [ ] args ) { int n = 5 ; System . out . println ( term ( n ) ) ; } }

Class/struct names: Series
Java program:
import java . util . Scanner ; class Deserium { static int countDigits ( int n ) { int c = 0 ; do { c ++ ; n = n / 10 ; } while ( n != 0 ) ; return c ; } static boolean isDeserium ( int x ) { int temp = x ; int p = countDigits ( x ) ; int sum = 0 ; while ( x != 0 ) { int digit = x % 10 ; sum += Math . pow ( digit , p ) ; p -- ; x = x / 10 ; } return ( sum == temp ) ; } public static void main ( String [ ] args ) { int x = 135 ; if ( isDeserium ( x ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }

Accumulator variables: c, p, sum
Class/struct names: Deserium
Java program:
class GFG { static int gcd ( int a , int b ) { if ( a == 0 ) return b ; return gcd ( b % a , a ) ; } static int sameRemainder ( int a , int b , int c ) { int a1 = ( b - a ) , b1 = ( c - b ) , c1 = ( c - a ) ; return gcd ( a1 , gcd ( b1 , c1 ) ) ; } public static void main ( String [ ] args ) { int a = 62 , b = 132 , c = 237 ; System . out . println ( sameRemainder ( a , b , c ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static float mean ( int arr [ ] , int n ) { int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) sum = sum + arr [ i ] ; float mean = ( float ) sum / n ; return mean ; } static float sd ( int arr [ ] , int n ) { float sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) sum = sum + ( arr [ i ] - mean ( arr , n ) ) * ( arr [ i ] - mean ( arr , n ) ) ; float sdd = sum / n ; return sdd ; } static float combinedVariance ( int arr1 [ ] , int arr2 [ ] , int n , int m ) { float mean1 = mean ( arr1 , n ) ; float mean2 = mean ( arr2 , m ) ; System . out . print ( " Mean1 : ▁ " + mean1 + " ▁ " ) ; System . out . println ( " Mean2 : ▁ " + mean2 ) ; float sd1 = sd ( arr1 , n ) ; float sd2 = sd ( arr2 , m ) ; System . out . print ( " StandardDeviation1 : ▁ " + sd1 + " ▁ " ) ; System . out . println ( " StandardDeviation2 : ▁ " + sd2 + " ▁ " ) ; float combinedMean = ( float ) ( n * mean1 + m * mean2 ) / ( n + m ) ; System . out . println ( " Combined ▁ Mean : ▁ " + combinedMean + " ▁ " ) ; float d1_square = ( mean1 - combinedMean ) * ( mean1 - combinedMean ) ; float d2_square = ( mean2 - combinedMean ) * ( mean2 - combinedMean ) ; System . out . print ( " d1 ▁ square : ▁ " + d1_square + " ▁ " ) ; System . out . println ( " d2 _ square : ▁ " + d2_square ) ; float combinedVar = ( n * ( sd1 + d1_square ) + m * ( sd2 + d2_square ) ) / ( n + m ) ; return combinedVar ; } public static void main ( String [ ] args ) { int arr1 [ ] = { 23 , 45 , 34 , 78 , 12 , 76 , 34 } ; int arr2 [ ] = { 65 , 67 , 34 , 23 , 45 } ; int n = arr1 . length ; int m = arr2 . length ; System . out . println ( " Combined ▁ Variance : ▁ " + combinedVariance ( arr1 , arr2 , n , m ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static boolean checkDivisibility ( String num ) { int length = num . length ( ) ; if ( length == 1 && num . charAt ( 0 ) == '0' ) return true ; if ( length % 3 == 1 ) { num += "00" ; length += 2 ; } else if ( length % 3 == 2 ) { num += "0" ; length += 1 ; } int sum = 0 , p = 1 ; for ( int i = length - 1 ; i >= 0 ; i -- ) { int group = 0 ; group += num . charAt ( i -- ) - '0' ; group += ( num . charAt ( i -- ) - '0' ) * 10 ; group += ( num . charAt ( i ) - '0' ) * 100 ; sum = sum + group * p ; p *= ( - 1 ) ; } sum = Math . abs ( sum ) ; return ( sum % 13 == 0 ) ; } public static void main ( String [ ] args ) { String number = "83959092724" ; if ( checkDivisibility ( number ) ) System . out . println ( number + " ▁ is ▁ divisible ▁ by ▁ 13 . " ) ; else System . out . println ( number + " ▁ is ▁ not ▁ divisible ▁ by ▁ 13 . " ) ; } }

Accumulator variables: group, i, length, num, p
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static void modularEquation ( int a , int b ) { if ( a < b ) { System . out . println ( " No ▁ solution ▁ possible ▁ " ) ; return ; } if ( a == b ) { System . out . println ( " Infinite ▁ Solution ▁ possible ▁ " ) ; return ; } int count = 0 ; int n = a - b ; int y = ( int ) Math . sqrt ( a - b ) ; for ( int i = 1 ; i <= y ; ++ i ) { if ( n % i == 0 ) { if ( n / i > b ) count ++ ; if ( i > b ) count ++ ; } } if ( y * y == n && y > b ) count -- ; System . out . println ( count ) ; } public static void main ( String [ ] args ) { int a = 21 , b = 5 ; modularEquation ( a , b ) ; } }

Accumulator variables: count
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; public class GFG { static int countWays ( int num ) { int [ ] dp = new int [ num + 1 ] ; int MOD = ( int ) 1E9 + 7 ; dp [ 1 ] = 2 ; for ( int i = 2 ; i <= num ; ++ i ) { dp [ i ] = 0 ; for ( int j = 1 ; j <= 3 ; ++ j ) { if ( i - j == 0 ) dp [ i ] += 1 ; else if ( j == 1 ) dp [ i ] += dp [ i - j ] * 2 ; else if ( i - j > 0 ) dp [ i ] += dp [ i - j ] ; if ( dp [ i ] >= MOD ) dp [ i ] %= MOD ; } } return dp [ num ] ; } static public void main ( String [ ] args ) { int n = 3 ; System . out . println ( countWays ( n ) ) ; } }

Index/key variables: i, num
Iterator variables: i, j
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static boolean sumSquare ( int n ) { HashMap < Integer , Integer > s = new HashMap < Integer , Integer > ( ) ; for ( int i = 0 ; i * i <= n ; ++ i ) { s . put ( i * i , 1 ) ; if ( s . containsKey ( n - i * i ) ) { System . out . println ( ( int ) Math . sqrt ( n - i * i ) + " ^ 2 ▁ + ▁ " + i + " ^ 2" ) ; return true ; } } return false ; } public static void main ( String [ ] args ) { int n = 169 ; System . out . print ( sumSquare ( n ) ? "YES " ▁ : ▁ " NO "); } }

Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; import java . lang . * ; class GFG { public static boolean judgeSquareSum ( int n ) { for ( int i = 2 ; i * i <= n ; i ++ ) { int count = 0 ; if ( n % i == 0 ) { while ( n % i == 0 ) { count ++ ; n /= i ; } if ( i % 4 == 3 && count % 2 != 0 ) return false ; } } return n % 4 != 3 ; } public static void main ( String argc [ ] ) { int n = 17 ; if ( judgeSquareSum ( n ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }

Accumulator variables: count, i, n
Iterator variables: i
Class/struct names: GFG