Featured

Skillenza society generalle hiring challenge (Binary Madness)

Problem Statement

import java.util.;
import java.lang.;
import java.io.*;
 import java.math.BigInteger;
 public class solution {
     public static void oddCount(List < String > substr) {
         int oddone = 0;
         int oddzero = 0;

         for (int i = 0; i < substr.size(); i++) {
             List < String > myList = new ArrayList < String > (Arrays.asList(substr.get(i).split("")));

             int zero = Collections.frequency(myList, "0");
             if (zero % 2 == 1)
                 oddzero++;

             int one = Collections.frequency(myList, "1");
             if (one % 2 == 1)
                 oddone++;
         }
         System.out.println(oddzero + " " + oddone);
     }

     public static void SubString(String str) {
         List < String > temp = new ArrayList < > ();
         int n = str.length();
         for (int i = 0; i < n; i++)
             for (int j = i + 1; j <= n; j++)
                 temp.add(str.substring(i, j));
         oddCount(temp);
     }



     public static void main(String[] args) {
         List < String > values = new ArrayList < > ();
         Scanner scanner = new Scanner(System.in);
         int n = scanner.nextInt();
         while (scanner.hasNext()) {
             values.add(String.valueOf(scanner.next()));
         }

         scanner.close();

         for (int i = 0; i < n; i++) {
             BigInteger num = new BigInteger(values.get(i));
             SubString(num.toString(2));
         }
     }
}

Input:

25
0
1
2
10
17
32
33
127
341
455
496
992
1000
430510914326
8470634074737128636070224
9893020956
3846435266552999150
977354604222
27055031064
6702565932198233123811
427738644490
65146
89623387
3773561366613203692478122629384
256651750668965698947092

Output:

1 0
0 1
2 2
6 6
9 8
12 6
10 10
0 16
24 25
25 24
16 21
24 24
24 28
399 399
1620 1760
286 306
986 992
420 420
315 275
1368 1353
391 375
42 72
192 192
2610 2542
1558 1558

AEM – Reusing touch dialog fields/tabs using include

Base Component – actual cq:dialog

<bannerImage jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/pathbrowser"
fieldDescription="Select banner image" fieldLabel="Banner Image"
name="./bannerImage" />

Reusing bannerImage field in other component

<bannerImage
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/include"
path="/apps/reuse/components/content/banner/cq:dialog/content/items/tab1/items/columns/items/bannerImage"/>

path – actual dialog field path which need to be reused in the different component, above xml forms the node in the crx/de as shown below and the cq:dialog field

Skillenza – Fincity Hiring challenge (Print asterisk * pyramid)

Solution Algorithm:

number of nodes in tree with height h
2^h - 1

number of leaf nodes in tree with height h
2^(h-1)


number of nodes at each level - 2^l (l - level)
total number of levels - (h-1) - l starts from 0


5 - 16 - 2^(5-1)
2 - 2 - 2^(2-1)
4 - 8 - 2^(4-1)


5
1-l-0 	= 15 -> 2^(5-1) - 1  				 - 2^0
2-l-1 	= 7, 15 				         - 2^1
3-l-2	= 3, 7, 7, 7				         - 2^2
4-l-3	= 1, 3, 3, 3, 3, 3, 3, 3			 - 2^3
5-l-4   = 0, 1						 - 2^4

       *
   *       *
 *   *   *   *
* * * * * * * *
****************

               *
       *               *
   *       *       *       *
 *   *   *   *   *   *   *   *
* * * * * * * * * * * * * * * *
import java.util.*;
import java.lang.Math; 
class solution {

    public static void main(String[] args) {

        List < Integer > values = new ArrayList < >();
        Scanner scanner = new Scanner(System. in );
        int n = scanner.nextInt();
        while (scanner.hasNext()) {
            values.add(Integer.valueOf(scanner.next()));
        }
        scanner.close();
        values.forEach(name -> getPattern(name));
        }
    public static void printSpaces(int n){
        for(int i = 0; i < n; i++){
            System.out.print(" ");
        }
        System.out.print("*");
    }
    public static void getPattern(int height){
       int nodes = (int)Math.pow(2, height) - 1;
       int leafNodes = (int)Math.pow(2, height-1);
       int levels = height-1;
       int initSpace = (int)Math.pow(2, height-1) - 1;
       int constSpace = initSpace/2;
       int levNodes;

       for(int i = 0; i < height; i++){
           levNodes = (int)Math.pow(2, i);
           for(int j = 0; j < levNodes; j++){
               if(j == 0)
               printSpaces(initSpace/2);
               else printSpaces(initSpace);
           }
           System.out.println();
           initSpace = initSpace/2;
           
        }
    }
    }

Input

10
5
1
2
1
4
3
6
4
3
6

Output:

       *
   *       *
 *   *   *   *
* * * * * * * *
****************
*
*
**
*
   *
 *   *
* * * *
********
 *
* *
****
               *
       *               *
   *       *       *       *
 *   *   *   *   *   *   *   *
* * * * * * * * * * * * * * * *
********************************
   *
 *   *
* * * *
********
 *
* *
****
               *
       *               *
   *       *       *       *
 *   *   *   *   *   *   *   *
* * * * * * * * * * * * * * * *
********************************

ShortList hiring Challenge – Minimum Swaps

Problem Statement

Solution (Implementation phase & open for changes & corrections)

import java.util. * ;
import java.lang. * ;
import java.io. * ;
 public class Main {
     private static long[][] grid;
     private static int a;
     private static int b;
	 private static int c;
	 private static long max;
	 private static int count;
	 private static List<int[][]> midPostn;
	 private static List<int[][]> maxPostn;
	  private static List<Integer> counter;
	 
	 public static void rowUp(int s1, int d1, int s2, int d2)
	 {
	    //int c = 0;
		if(!(s1 == d1)){
		int i;
		for(i = s1; i > d1; i--){
			c++;
			
		}
		s1 = d1;
		
		//System.out.println("rowup "+c);
	   if(!((s1 == d1)&&(s2 == d2))){
		if(s2 < d2){
			if(s2-1 >= 0)
		    columnRight(s1, d1, s2-1, d2);
		} else if(s2 > d2){
			if(s2+1 < b)
			columnLeft(s1, d1, s2+1, d2);				
		}
		}
		}
	 }
	 
	 public static void rowDown(int s1, int d1, int s2, int d2)
	 {
	    //int c = 0; 
		if(!(s1 == d1)){
		int i;
		for(i = s1; i < d1; i++)
			c++;
		s1 = d1;
		
		//System.out.println("rowDown "+c);
	    if(!((s1 == d1)&&(s2 == d2))){
		if(s2 < d2){
			if(s2-1 >= 0)
		    columnRight(s1, d1, s2-1, d2);
		} else if(s2 > d2){
			if(s2+1 < b)
			columnLeft(s1, d1, s2+1, d2);				
		}
		}
		}
	 }
	 
	 public static void columnLeft(int s1, int d1, int s2, int d2)
	 {
	     //int c = 0; 
		 if(!(s2 == d2)){
		int i;
		for(i = s2; i > d2; i--)
			c++; 
		s2 = d2;
		
		//System.out.println("columnLeft "+c);
		if(!((s1 == d1)&&(s2 == d2))){
		if(s1 > d1){
			if(s1-1 >= 0)
		    rowUp(s1-1, d1, s2, d2);
		} else if(s1 < d1){
			if(s1+1 < a)
			rowDown(s1+1, d1, s2-1, d2);
		}
		}
		 }
	 }
	 
	 public static void columnRight(int s1, int d1, int s2, int d2)
	 {
	     //int c = 0; 
		if(!(s2 == d2)){
		int i;
		for(i = s2; i < d2; i++)
			c++;  
		s2 = d2;
		
		//System.out.println("columnRight "+c);
    	if(!((s1 == d1)&&(s2 == d2))){
		if(s1 > d1){
			if(s1-1 >= 0)
		    rowUp(s1-1, d1, s2, d2);
		} else if(s1 < d1){
			if(s1+1 < a)
			rowDown(s1+1, d1, s2, d2);
		}
		}
		}
	 }
	
	public static void posNavigate() {
		int i, j, s1, d1, s2, d2;
		counter = new ArrayList < >();
		for(i = 0; i < maxPostn.size(); i++){
			for(j = 0; j < midPostn.size(); j++){
				s1 = maxPostn.get(i)[0][0];
				s2 = maxPostn.get(i)[0][1];
				d1 = midPostn.get(j)[0][0];
				d2 = midPostn.get(j)[0][1];
				
				c = 0;
				if(s1 > d1){
					rowUp(s1, d1, s2, d2);
				} else if(s1 < d1){
					rowDown(s1, d1, s2, d2);
				} else if(s2 < d2){
					columnRight(s1, d1, s2, d2);
				} else if(s2 > d2){
				    columnLeft(s1, d1, s2, d2);
				}
				counter.add(c);
			}
		} 
		Collections.sort(counter);
		for(i = 0; i < counter.size(); i++){
		System.out.print(counter.get(i)+ " ");
		}System.out.println();
		
	}
	public static void maxPos() {
	maxPostn = new ArrayList<int[][]>();
	int[][] mxpsn = new int[1][2];
	for(int i = 0; i < a; i++){
		for(int j = 0; j < b; j++){
			if(grid[i][j] == max){
				mxpsn[0][0] = i;
				mxpsn[0][1] = j;
				maxPostn.add(mxpsn);
			}
		}
	}
	
}

public static void midPos() {
	int count;
	midPostn = new ArrayList<int[][]>();
	int[][] mpsn = new int[1][2];
    if((a%2 != 0) && (b%2 != 0))
	{
		count = 1;
		mpsn = new int[1][2];
		mpsn[0][0] =  a/2;
		mpsn[0][1] =  b/2;
		midPostn.add(mpsn);
	}
	else if((a%2 != 0) && (b%2 == 0))
	{
		count = 2;
		mpsn = new int[1][2];
		mpsn[0][0] = a/2;
		mpsn[0][1] = b/2;
		midPostn.add(mpsn);
		
		mpsn = new int[1][2];
		mpsn[0][0] = a/2;
		mpsn[0][1] = b/2 - 1;
		midPostn.add(mpsn);
		
	}
	
	else if((a%2 == 0) && (b%2 != 0))
	{
		count = 2;
		mpsn = new int[1][2];
		mpsn[0][0] = a/2;
		mpsn[0][1] = b/2;
		midPostn.add(mpsn);
		
		mpsn = new int[1][2];
		mpsn[0][0] = a/2 - 1;
		mpsn[0][1] = b/2;
		midPostn.add(mpsn);
	}
	else if((a%2 == 0) && (b%2 == 0))
	{
		count = 4;
		mpsn = new int[1][2];
		mpsn[0][0] = a/2;
		mpsn[0][1] =  b/2;
		midPostn.add(mpsn);
		
		mpsn = new int[1][2];
		mpsn[0][0] =  a/2 - 1;
		mpsn[0][1] =  b/2 - 1;
		midPostn.add(mpsn);
		
		mpsn = new int[1][2];
		mpsn[0][0] = a/2;
		mpsn[0][1] = b/2 - 1;
		midPostn.add(mpsn);
		
		mpsn = new int[1][2];
		mpsn[0][0] = a/2 - 1;
		mpsn[0][1] = b/2;
		midPostn.add(mpsn);
	}
}

 
public static void multiDimension(List < Long > table) {
    a = table.get(0).intValue();
    b = table.get(1).intValue();
    table.remove(0);
    table.remove(0);
    int i, j;
	max = Collections.max(table);
	count = Collections.frequency(table, max);
    grid = new long[a][b];
    
	
    int k = 0;
    for (i = 0; i < a; i++) {
        for (j = 0; j < b; j++) {
            grid[i][j] = table.get(k);
            k++;
        }
    }
	midPos();
	maxPos();
	posNavigate();
}
 
public static void main(String[] args) {
    List < Long > values = new ArrayList < >();
    List < Long > temp = new ArrayList < >();
 
    Scanner scanner = new Scanner(System. in );
    int n = scanner.nextInt();
    while (scanner.hasNext()) {
        values.add(Long.valueOf(scanner.next()));
    }
 
    scanner.close();
 
    int q = 0, j;
    for (int i = 0; i < n; i++) {
        for (j = q; j < (values.get(q) * values.get(q + 1) + 2 + q); j++) {
            temp.add(values.get(j));
            if (temp.size() == values.get(q) * values.get(q + 1) + 2) {
                multiDimension(temp);
            }
        }
        temp.clear();
        q += values.get(q) * values.get(q + 1) + 2;
 
    }
}
}

Input

19
3 3
1 2 3
4 5 6
7 8 9
4 3
9 7 7
4 2 8
9 6 6
8 3 2
1 6
1 5 2 3 4 5
1 1
100
6 1
3
2
1
1
2
3
2 2
1 1
1 1
1 7
2 3 1 2 1 2 3
1 6
19 6 3 1 4 19
4 4
1 1 1 1
1 2 2 1
1 2 2 1
1 1 1 1
4 4
2 2 2 2
2 1 1 2
2 1 1 2
2 2 2 2
4 4
2 1 1 2
1 1 1 1
1 1 1 1
2 1 1 2
5 9
86 42 68 43 59 68 52 33 20
42 20 85 33 33 85 86 33 85
59 52 68 20 42 52 80 68 52
42 43 85 68 80 85 80 43 52
43 42 20 80 33 86 85 68 33
10 8
75 80 55 78 83 53 35 92
96 39 20 40 81 20 64 56
38 45 97 46 23 82 96 22
50 54 83 89 66 54 24 26
75 25 28 79 24 62 88 93
94 95 59 85 70 99 22 16
97 21 52 30 62 74 45 82
54 39 82 92 48 31 29 49
56 24 11 54 77 79 10 37
99 31 14 99 90 18 32 24
9 7
67 41 90 25 92 41 42
65 24 51 58 73 87 74
96 14 40 93 97 12 33
71 60 67 20 89 39 62
78 97 63 88 82 92 87
26 15 73 61 46 28 74
20 40 22 54 29 73 98
34 76 60 41 70 98 89
56 95 34 48 10 80 13
11 10
850 619 786 902 776 191 147 676 414 905
604 409 288 272 746 913 891 989 282 871
879 315 154 497 180 410 761 433 971 725
550 220 578 784 143 874 491 340 641 339
609 940 506 711 809 348 683 845 241 889
942 244 736 541 169 964 544 378 907 534
526 200 742 978 995 680 170 823 328 263
737 716 635 312 793 274 165 463 515 120
778 796 806 376 993 468 594 262 509 480
535 105 621 359 803 326 298 777 872 877
795 879 919 597 261 523 429 598 677 893
9 10
184 236 739 342 368 963 108 146 983 435
946 357 153 446 433 133 189 796 438 852
243 196 287 298 491 286 688 704 608 377
609 397 718 631 912 559 785 655 250 120
102 688 761 115 700 804 888 787 704 948
488 666 340 960 347 940 904 200 902 457
794 632 708 493 628 439 680 846 539 306
947 456 288 783 594 907 757 290 279 124
394 517 323 436 930 456 828 616 803 175
9 12
581 350 778 286 586 229 265 368 406 700 605 777
881 517 489 449 802 276 321 900 789 303 264 274
831 955 774 750 744 726 744 489 451 404 874 188
962 768 503 617 527 174 658 167 457 549 382 651
758 112 344 389 533 502 758 758 913 240 526 110
640 813 579 516 978 968 731 396 503 967 283 562
918 855 755 126 754 599 104 146 148 994 416 567
173 385 733 281 537 446 752 569 105 828 147 508
426 974 196 348 939 699 624 680 125 529 995 394
10 13
140 370 871 916 967 531 369 704 315 346 685 789 561
748 897 335 243 799 732 144 504 596 654 299 542 147
869 548 655 482 923 117 767 932 746 725 720 912 924
633 349 313 919 396 305 369 926 168 882 725 186 923
641 167 995 323 179 221 117 232 955 399 350 584 614
261 282 453 827 653 472 721 243 570 725 972 345 803
378 125 217 261 105 129 794 957 559 819 249 560 364
201 712 218 275 875 342 547 898 420 296 798 746 650
420 332 895 230 633 210 228 248 414 699 734 197 952
165 164 319 623 723 117 515 451 672 120 907 712 547
10 11
312 968 305 468 265 286 835 170 313 715 650
574 781 122 523 890 182 817 933 940 529 732
100 514 356 511 781 740 125 618 379 482 403
439 117 660 720 599 280 946 159 711 663 462
990 969 473 472 281 604 153 966 841 458 937
732 171 299 316 963 823 484 423 704 686 640
419 772 670 315 467 821 577 661 842 814 396
482 147 961 903 642 440 763 220 703 962 313
824 268 586 214 497 731 140 861 299 970 386
179 658 716 988 968 722 933 733 368 250 446

Output

2
1
1
0
2
0
2
2
0
1
2
3
1
5
1
7
8
4
5

SkillenZa FinBox hiring challenge (Gangs of primes and composites)

Problem Statement

Solution (Source Code) in Java

import java.util. * ;
import java.lang. * ;
import java.io. * ;
 public class solution {
     private static int[][] grid;
     private static int a;
     private static int b;
public static int rightNav(int r, int c, int init, boolean flag) {
    int i, j;
    if ((r < a) && (c < b)) {
        if (!isPrime(grid[r][c], flag) && grid[r][c] != 0) {
            init = 1;
            for (i = r; i < r + 1; i++) {
                for (j = c; j < b; j++) {
                    if (r < a) {
                        if (!isPrime(grid[i][j], flag) && grid[i][j] != 0) {
                            grid[i][j] = 0;
                            if (i > 0) upNav(i - 1, j, flag);
                            if (i + 1 < a) downNav(i + 1, j, flag);
                        } else break;
                    }
                }
            }
        }
    }
    return init;
}
public static void rightNav(int r, int c, boolean flag) {
    int i, j;
    if ((r < a) && (c < b)) {
        if (!isPrime(grid[r][c], flag) && grid[r][c] != 0) {
            for (i = r; i < r + 1; i++) {
                for (j = c; j < b; j++) {
                    if (r < a) {
                        if (!isPrime(grid[i][j], flag) && grid[i][j] != 0) {
                            grid[i][j] = 0;
                            if (i > 0) {
                                upNav(i - 1, j, flag);
                            }
                            if (i + 1 < a) downNav(i + 1, j, flag);
                        } else break;
                    }
                }
            }
        }
    }
}

public static void leftNav(int r, int c, boolean flag) {
    int i, j;
    if ((r < a) && (c < b)) {
        if (!isPrime(grid[r][c], flag) && grid[r][c] != 0) {
            for (i = r; i < r + 1; i++) {
                for (j = c; j >= 0; j--) {
                    if (r < a) {
                        if (!isPrime(grid[i][j], flag) && grid[i][j] != 0) {
                            grid[i][j] = 0;
                            if (i > 0) upNav(i - 1, j, flag);
                            if (i + 1 < a) downNav(i + 1, j, flag);
                        } else break;
                    }
                }
            }
        }
    }
}

public static void downNav(int r, int c, boolean flag) {
    int i,  j;
    if ((r < a) && (c < b)) {
        if (!isPrime(grid[r][c], flag) && grid[r][c] != 0) {
            for (i = c; i < c + 1; i++) {
                for (j = r; j < a; j++) {
                    if (c < b) {
                        if (!isPrime(grid[j][i], flag) && grid[j][i] != 0) {
                            grid[j][i] = 0;
                            if (i > 0) leftNav(j, i - 1, flag);
                            if (i + 1 < b) rightNav(j, i + 1, flag);
                        } else break;
                    }
                }
            }
        }
    }
}

public static void upNav(int r, int c, boolean flag) {
    int i, j;
    if ((r < a) && (c < b)) {
        if (!isPrime(grid[r][c], flag) && grid[r][c] != 0) {
            for (i = c; i < c + 1; i++) {
                for (j = r; j >= 0; j--) {
                    if (c < b) {
                        if (!isPrime(grid[j][i], flag) && grid[j][i] != 0) {
                            grid[j][i] = 0;
                            if (i > 0) leftNav(j, i - 1, flag);
                            if (i + 1 < b) rightNav(j, i + 1, flag);
                        } else break;
                    }
                }
            }
        }
    }
}

public static void comNavigate(boolean diff) {
    int flag = 0, count = 0, i, j;
    for (i = 0; i < a; i++) {
        for (j = 0; j < b; j++) {
            flag = 0;
            flag = rightNav(i, j, 0, diff);
            if (flag == 1) count++;
        }
    }
    System.out.print(count + " ");

}
public static boolean isPrime(int num, boolean flag) {

    for (int i = 2; i <= num / 2; ++i) {
        if (num % i == 0) {
            flag = !flag;
            break;
        }
    }
    return flag;
}

public static void multiDimension(List < Integer > table) {
    a = table.get(0);
    b = table.get(1);
    table.remove(0);
    table.remove(0);
    int i, j;
    grid = new int[a][b];

    int k = 0;
    for (i = 0; i < a; i++) {
        for (j = 0; j < b; j++) {
            grid[i][j] = table.get(k);
            k++;
        }
    }
    comNavigate(false);
    comNavigate(true);
    System.out.println();
}

public static void main(String[] args) {
    List < Integer > values = new ArrayList < >();
    List < Integer > temp = new ArrayList < >();

    Scanner scanner = new Scanner(System. in );
    int n = scanner.nextInt();
    while (scanner.hasNext()) {
        values.add(Integer.valueOf(scanner.next()));
    }

    scanner.close();

    int q = 0, j;
    for (int i = 0; i < n; i++) {
        for (j = q; j < (values.get(q) * values.get(q + 1) + 2 + q); j++) {
            temp.add(values.get(j));
            if (temp.size() == values.get(q) * values.get(q + 1) + 2) {
                multiDimension(temp);
            }
        }
        temp.clear();
        q += values.get(q) * values.get(q + 1) + 2;

    }
}
}

Input

16
1 1
2
1 1
4
3 1
2
4
2
1 3
4 2 4
3 2
3 6
9 4
9 3
4 5
6 5 3 2 9
3 2 7 6 8
6 6 7 2 6
6 5 6 9 5
2 11
5 4 6 7 9 9 8 2 6 2 5
7 3 5 2 6 6 6 2 6 9 5
8 7
3 6 8 5 6 7 8
2 4 2 7 8 5 5
3 7 6 4 9 7 2
9 6 5 3 5 4 2
4 6 3 4 5 2 8
3 3 2 4 7 9 2
6 2 9 4 6 4 7
9 4 9 2 8 5 9
20 19
6 8 6 2 2 3 4 5 5 6 3 8 8 5 3 2 5 8 7
8 4 2 2 9 9 9 5 2 7 4 3 9 5 4 3 2 4 9
6 8 7 8 7 7 7 4 6 3 7 4 9 9 6 4 7 4 3
5 4 9 4 7 5 5 7 6 8 9 5 7 3 4 8 6 4 8
5 5 7 8 5 4 4 5 4 9 9 7 7 8 5 9 9 3 5
5 9 8 9 6 3 9 6 4 2 3 8 9 7 4 7 7 9 8
5 4 3 3 6 8 9 7 2 2 8 6 2 3 6 8 9 8 8
8 7 7 4 9 5 2 4 7 7 2 6 3 4 7 2 5 7 6
3 5 6 9 5 7 5 4 8 6 4 7 6 9 7 8 5 5 7
9 6 6 3 2 8 7 2 6 7 8 4 7 5 9 4 3 8 6
4 4 7 3 4 4 4 8 2 3 2 9 4 8 9 9 3 5 6
5 9 4 6 7 5 6 2 6 7 8 5 3 6 7 2 9 9 2
4 7 5 4 4 7 3 5 7 4 5 6 2 8 7 3 5 6 9
6 7 9 2 6 7 3 8 4 6 5 7 3 9 7 6 6 3 2
9 5 9 4 7 6 6 2 8 2 7 8 6 9 7 5 7 6 9
8 3 3 6 5 9 7 9 3 6 7 9 4 9 3 9 9 9 8
7 3 9 5 8 4 5 9 3 8 8 6 3 6 7 8 2 8 3
9 7 7 8 4 2 3 6 3 9 7 8 6 5 4 9 2 9 6
8 4 6 2 3 7 8 8 6 4 2 6 7 8 8 2 6 9 9
8 7 5 2 5 5 7 9 4 2 4 2 5 9 2 2 5 5 5
5 1
12
43
33
17
42
1 6
91 27 72 38 52 47
4 6
47 16 94 76 68 46
38 35 69 97 45 56
67 67 83 68 74 15
89 59 78 35 98 50
6 13
10 10 96 88 75 68 36 53 81 49 64 86 18
45 91 86 37 41 22 50 77 19 91 73 95 58
61 59 86 84 80 92 75 44 98 65 36 33 70
89 77 42 10 17 34 10 22 82 74 14 84 82
34 77 90 42 12 61 46 37 75 59 43 86 79
36 26 20 41 29 16 72 42 31 56 24 76 70
7 11
52 77 38 30 55 92 12 37 51 88 98
11 79 12 75 55 41 53 15 22 61 39
91 97 67 63 32 58 72 25 51 56 35
83 14 29 57 95 32 57 17 92 30 57
68 92 53 37 31 32 70 88 40 28 72
63 15 36 13 77 31 85 34 14 21 47
36 81 89 32 54 36 59 94 47 93 13
14 10
44 73 68 49 93 38 68 19 48 90
99 56 61 13 74 30 84 91 72 69
10 99 53 53 53 33 67 48 88 78
37 30 14 17 48 42 61 54 21 22
97 70 12 48 45 61 16 55 33 56
44 74 40 57 14 64 35 48 77 78
58 80 81 14 40 70 13 25 28 36
25 15 90 24 90 20 60 95 10 58
75 43 63 55 71 31 13 27 15 21
20 19 38 12 38 42 63 66 57 12
28 39 18 68 35 46 94 45 48 51
59 87 19 91 34 38 71 67 61 35
47 62 94 61 33 94 75 17 23 34
76 32 14 65 51 59 97 14 56 90
4 14
78 35 62 85 41 82 85 32 78 33 73 67 60 59
77 58 36 29 24 88 74 11 10 26 24 86 20 22
38 80 84 26 42 20 23 19 88 89 67 30 11 58
33 59 95 85 30 76 19 68 37 74 17 15 59 52

Output

1 0
0 1
2 1
1 2
2 1
3 4
3 3
7 8
43 26
2 3
1 1
3 1
12 1
11 4
14 1
9 3

Hunk – The Nerdy Programmer

Continuously participates in programming hackathons or competitive programming, conducted online on various platforms (TechGig, HackerRank, HackerEarth, SkillEnza), includes hiring challenges will post here what all the problems I have solved along with the solutions in Java

People can post their problem here so that I will be able to give you the solution and also I can learn

Why do this?

  • Because many beginners are afraid to give their first programming challenge, once they get the references online they will be able to cope up with the circumstances
  • Because it will help me to keep the track of my own activities which are worth sharing

Design a site like this with WordPress.com
Get started