You are viewing a single comment's thread. Return to all comments →
Java Solution
public static List<Integer> icecreamParlor(int m, List<Integer> arr) { List<Integer> list = new ArrayList<>(); for(int i=0; i< arr.size()-1; i++){ for(int j=i+1; j<arr.size(); j++){ if(arr.get(i) + arr.get(j) == m){ list.add(i+1); list.add(j+1); } } } return list; }
Seems like cookies are disabled on this browser, please enable them to open this website
Ice Cream Parlor
You are viewing a single comment's thread. Return to all comments →
Java Solution