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.
import java.util.Scanner;
- prasad_204@hotmail.com June 20, 2017public class CaluculateENhancement {
static int length;
static int poss;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
length = sc.nextInt();
StringBuffer inp=new StringBuffer();
generateString(inp, length, 0,1);
System.out.println("done bro..."+poss);
}
private static StringBuffer generateString(StringBuffer str, int len, int index, int pos){
String strChar[] ={"a","b","c"};
if(str.length()==length){
if(validate(str))poss++;
return str;
}
for(int k=0; k<strChar.length; k++){
str.append(strChar[k]);
generateString(str, len, index, pos+1);
str.deleteCharAt(str.length()-1);
}
return str;
}
private static boolean validate(StringBuffer str) {
char ch[] = str.toString().toCharArray();
for(int i=0;i<str.length();i++){
if(ch[i]=='b'){
if(i-1>-1){
if(ch[i-1]=='b'){
return false;
}
}
}else if(ch[i]=='c'){
if(i-1>-1){
if(ch[i-1]=='c'){
return false;
}
}
if(i-2>-1){
if(ch[i-2]=='c'){
return false;
}
}
}
}
return true;
}
}