Google Foobar Level 3 - Lucky Triples (Find the Access Codes)
Optimizing this algorithm


                if(l[i3]%l[i2]==0 &amp;&amp; l[i2]%l[i1]==0 &amp;&amp; !log.contains(new ArrayList&lt;&gt;(Arrays.asList(l[i1], l[i2], l[i3])))){



I have two problems with this section of code.  

First, in l[i2]%l[i1]==0, this will return the same result regardless of the value of i3.  So why is it inside the i3 loop?  It could be before that loop and skip the loop if not true.  

Second, you use List.contains with an arbitrarily long list.  The longer the list, the slower that method is.  Consider using a HashSet instead.  Then the speed remains constant relative to the size.  

With these two changes:  

    public static int answer(int[] l) {
        Set&lt;List&lt;Integer&gt;&gt; log = new HashSet&lt;&gt;();
        for (int i1 = 0; i1 &lt; l.length; i1++) {
            for (int i2 = i1 + 1; i2 &lt; l.length; i2++) {
                if (l[i2] % l[i1] != 0) {
                    continue;
                }

                for (int i3 = i2 + 1; i3 &lt; l.length; i3++) {
                    if ((l[i3] % l[i2] == 0)) {
                        log.add(Arrays.asList(l[i1], l[i2], l[i3]));
                    }
                }
            }
        }

        return log.size();
    }


Now you only check the third element if the first two elements are divisible.  

And now, instead of using List.contains, you simply rely on the uniqueness of elements of a Set.  

I also switched to use the interfaces as the types for log rather than the implementation.  This allows me to skip the new ArrayList operations altogether.  

I'm not crazy about the variable names either, but I didn't try to change them.  

Assumptions

Both your original and this variant assume that the list is sorted in ascending order.  

Custom datatype

This solution probably takes longer for small result sets, because HashSet is often higher overhead than List.  You may be able to reduce the overhead by declaring your own type and providing an optimized hashCode method for it.  Or the compiler may have already optimized it.  You'll have to benchmark to be sure.