You are viewing a single comment's thread. Return to all comments →
public static List<Integer> icecreamParlor(int m, List<Integer> arr) { for (int i = 0; i < arr.size(); i++) { if (arr.subList(i + 1, arr.size()).contains(m - arr.get(i))) { return Stream.of(i + 1, arr.lastIndexOf(m - arr.get(i)) + 1).sorted().collect(Collectors.toList()); } } // WTF? return null; }
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 →