package leetcode;

import java.util.List;

/**
 * https://leetcode.com/problems/self-dividing-numbers/
 */
public class Problem728 {
    public List<Integer> selfDividingNumbers(int left, int right) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
        Problem728 prob = new Problem728();
        System.out.println(prob.selfDividingNumbers(1, 22)); // [1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 15, 22]
    }
}

@@ -12,16 +12,44 @@
 tcode;%0A%0A
+import java.util.ArrayList;%0A
 import j
@@ -63,16 +63,16 @@
 l.List;%0A
-
 %0A/**%0A * 
@@ -234,240 +234,501 @@
     
-// TODO%0A        return null;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Problem728 prob = new Problem728();%0A        System.out.println(prob.selfDividingNumbers(1, 22)); // %5B1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 15, 22%5D
+List%3CInteger%3E result = new ArrayList%3C%3E();%0A        for (int i = left; i %3C= right; i++) %7B%0A            String str = %22%22 + i;%0A            boolean found = true;%0A            for (int j = 0; j %3C str.length(); j++) %7B%0A                int a = str.charAt(j) - '0';%0A                if (a == 0 %7C%7C i %25 a != 0) %7B%0A                    found = false;%0A                    break;%0A                %7D%0A            %7D%0A            if (found) %7B%0A                result.add(i);%0A            %7D%0A        %7D%0A        return result;
 %0A   

Solve problem 728