Java solution with given hint
class Solution {\n\n\n    public List prefixesDivBy5(int[] a) {\n        List l = new ArrayList<>();\n        long num = a[0];\n        l.add(num%5 == 0?true:fa
class Solution {\n\n\n    public List<Boolean> prefixesDivBy5(int[] a) {\n        List<Boolean> l = new ArrayList<>();\n        long num = a[0];\n        l.add(num%5 == 0?true:false);\n        for(int i=1;i<a.length;i++){\n            num = 2*num +a[i];\n            l.add(num%5 == 0?true:false);\n            num = num%10;\n        }\n        return l;\n    }\n}
[]