is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.
Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.
Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.
/* I did not sort the array . Sort the array in descending order and then iterate through array
- neeraj.gautam94 July 19, 2014it will work for all the above case which got failed . */
import java.util.ArrayList;
import java.util.Scanner;
public class FIndOptimalArray {
int [] arr;
ArrayList<Integer> a1 = new ArrayList<>();
ArrayList<Integer> a2 = new ArrayList<>();
int sum1,sum2;
int diff;
int size;
public void getSizeOfArray(){
Scanner sc = new Scanner(System.in);
System.out.println("Enter the number of integer");
size = sc.nextInt();
arr = new int[size];
System.out.println("Enter the numbers one by one");
for (int i=0; i<size; i++) {
arr[i] = sc.nextInt();
}
}
public int findDifference() {
for (int i=0; i<size; i++) {
if (diff == 0) {
a1.add(arr[i]);
sum1 += arr[i];
}
else if (diff < 0) {
a1.add(arr[i]);
sum1 += arr[i];
}
else {
a2.add(arr[i]);
sum2 += arr[i];
}
diff = sum1 - sum2;
}
return Math.abs(diff);
}
}