Skip to content

Commit

Permalink
commit-3
Browse files Browse the repository at this point in the history
  • Loading branch information
kmchau428 committed Jan 21, 2016
1 parent 7a2fc5a commit 8b98a0b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/main/java/com/develogical/app/QueryProcessor.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.develogical.app;

import java.util.Arrays;

public class QueryProcessor {

public String process(String query) throws InterruptedException {
Expand All @@ -23,7 +25,14 @@ else if (query.toLowerCase().contains("plus")) {

return String.valueOf(intOne + intTwo);
}

else if (query.toLowerCase().contains("largest")) {
String[] array = query.split("largest:");
String[] strArray = array[1].split(",");
Arrays.sort(strArray);

return strArray[strArray.length-1];

}
else {
Thread.sleep(100000);
}
Expand Down

0 comments on commit 8b98a0b

Please sign in to comment.