eminsqa
BAN USER- 0of 0 votes
Answersgiven a string, calculate the frequency of characters, output the array with the letter and frequency. (such as: for “abbcdc”, the output should be (a,1),(b,2),(c,2),(d,1))
- eminsqa in United States for AmazonMusic| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Quality Assurance Algorithm Java - 0of 0 votes
AnswersYou are at Amazon search-box, please specify, what Test Cases / Test Plans would you write down: Just name them, don't provide steps, consider wider scope not just functionality.
- eminsqa in United States for AmazonMusic| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Quality Assurance Testing
public class Validation {
static char open= '(';
static char close = ')' ;
public static boolean isValid(byte[] expr) {
int sum = 0;
for(int i=0; i<expr.length; i++) {
if(expr[i] == open) {
sum++;
}
else if (expr[i] == close){
sum--;
if (sum < 0) {
return false;}
}
}
if (sum == 0) {
return true;}
else {
return false;}
}
public static void main(String[] args) {
String expr = "())(";
if (isValid(expr.getBytes()) == true) {
System.out.println("Valid Expression");
}
else {
System.out.println("Invalid Expression");
}
}
}
Repsushiplarson, Animator at Achieve Internet
Hi, I am a creative Assistant Video Editor with experience in all aspects of video production. Working at a post-production ...
Repsherrifjenkins, Applications Developer at ASAPInfosystemsPvtLtd
I am Sherri from Richmond USA. I am working as a Clinical laboratory technician worker in P. Samuels Men's ...
Reppaulajheineman, Consultant at Bank of America
Hello, I am from Las Vegas, NV.Completed a Diploma course in Advanced Technological Developments and Staff Management. I have ...
Repleancpuryear, Data Scientist at Adjetter Media Network Pvt Ltd.
Hi guys!! My name is Lean C Puryear and I love fashion, I hope to some day get into the ...
Repabbyhgabb, Associate at Abs india pvt. ltd.
Develop fresh content for emails, web banners, site wide communication, and subject lines.Write stories, blogs and related content about ...
Outout is not number 1, it is first non repeating letter "l" (Letter "L" lower case)
- eminsqa January 28, 2016