# The return result is correct in local running, but not in OJ

• For test cases: equations = [ ["a", "b"], ["b", "c"] ]. values = [2.0, 3.0]. queries = [ ["a", "c"], ["b", "c"], ["a", "e"], ["a", "a"], ["x", "x"] ].
The return result is correct in local running, but not in OJ. Is there anyone can find the bug?

``````public class Solution {
public double[] calcEquation(String[][] equations, double[] values, String[][] query) {
double[] res=new double[query.length];
if(query.length==0) return res;
Set<Tuple> set=new HashSet<Tuple>();
for(int i=0;i<equations.length;i++){
}
for(int i=0;i<equations.length;i++){
Set<Tuple> tmpSet=new HashSet<Tuple>();
for(Tuple t:set){
if(equations[i][1]==t.s1){
}
}
}
boolean flag=false;
for(int i=0;i<query.length;i++){
flag=false;
for(Tuple t: set){
if(flag==false && t.s1.equals(query[i][0]) && t.s2.equals(query[i][1])){
res[i]=t.val;
flag=true;
}
}
if(flag==false) res[i]=-1.0;

}
return res;
}
}

class Tuple{
String s1;
String s2;
double val;
Tuple(String s1, String s2, double val){
this.s1=s1;
this.s2=s2;
this.val=val;
}

}
``````

• add a query ["c", "a"] for test

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.