This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class math { | |
public static void main(String []args){ | |
Scanner sc=new Scanner(System.in); | |
int a=sc.nextInt(); | |
int b=sc.nextInt(); | |
int sum=63,total=3000; | |
for(int i=0;i<sum;i++){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class UnityInZerosAlternativveMethod { | |
public static int[] unityInZeros(int[] input1) | |
{ | |
int [] output=new int [input1.length]; | |
int k=0; | |
for(int i=0;i<input1.length;i++){ | |
for(int j=0;j<input1.length-1;j++){ | |
if(input1[j]==0&&input1[j+1]!=0){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class Testing2 { | |
public static void main(String [] args){ | |
Scanner sc=new Scanner(System.in); | |
int size; | |
size=sc.nextInt(); | |
int [] arr=new int [size]; | |
int sorted[]=new int[size]; //sorted array created to preserve non 5 multiples in the same order. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* You will be given an array and a number and you need to find the | |
* number of triplet in the array whose sum is equal to given number in the input. | |
*/ | |
import java.io.*; | |
import java.util.*; | |
public class CandidateCode { | |
public static void main(String args[] ) throws Exception { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Enter your code here. Read input from STDIN. Print your output to STDOUT. | |
* Your class should be named CandidateCode. | |
*/ | |
import java.io.*; | |
import java.util.*; | |
public class CandidateCode { | |
public static void main(String args[] ) throws Exception { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Enter your code here. Read input from STDIN. Print your output to STDOUT. | |
* Your class should be named CandidateCode. | |
*/ | |
import java.io.*; | |
import java.util.*; | |
public class CandidateCode { | |
public static void main(String args[] ) throws Exception { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* You will be given an array and you need to find the second largest and second smallest numbers and add them. | |
*Note: the length of the array should not be less than 2. | |
*/ | |
import java.io.*; | |
import java.util.*; | |
public class CandidateCode { | |
public static void main(String args[] ) throws Exception { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* you will be taking a number as an input from STDIN which tells about the length of the array. | |
* On another line, array elements should be there with single space between them. | |
*/ | |
import java.io.*; | |
import java.util.*; | |
public class CandidateCode { | |
public static void main(String args[] ) throws Exception { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* For this challenge, you will be given an array and you are asked to count | |
* how many numbers are negative and multiply them and print the output to the STDOUT. | |
*/ | |
import java.io.*; | |
import java.util.*; | |
public class CandidateCode { | |
public static void main(String args[] ) throws Exception { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* You will be given an array and you need to find the whether there is any element occurring thrice. | |
* If yes, then print 'True' else print 'False' | |
*/ | |
import java.io.*; | |
import java.util.*; | |
public class CandidateCode { | |
public static void main(String args[] ) throws Exception { |
NewerOlder