sathyamoorthybe
BAN USER
Questions (6)
Comments (1)
Reputation 115
- 0of 0 votes
AnswersCount the number of occurrance of the elements in the given array
- sathyamoorthybe in India| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer - -3of 3 votes
AnswersInsertion point from of linked list
- sathyamoorthybe in India| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer - 1of 1 vote
AnswersFind the max poduct value of 3 number from the given array .
- sathyamoorthybe in India
For example , if array has [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16] find the max product from three numbers. max_product(x*x*x)
Twist is array can contain negative number as well| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Quality Assurance - 0of 0 votes
AnswersPrint the 2x2 matrix in sprial format .
- sathyamoorthybe in India| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Quality Assurance
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
Logic is works well .Adding addtional verification.
- sathyamoorthybe August 22, 2014if (s1.length()!=s2.length())
return false;
int len = s1.length();
// double String "s2";
s1 = s1+s1;
for (int i=0;i<len;i++) {
if (s1.substring(i,i+len).equals(s2)) {
if (i==2) {
System.out.println("Left Roatation works");
return true;
} else {
i=i+len-1;
String ch = s1.substring(i+1,len*2);
if (ch.length() == 2) {
System.out.println("Right rotation works");
}
}
}
}
return false;
}