@@ -0,0 +1,905 @@
+public class Solution %7B%0A  public boolean isAdditiveNumber(String num) %7B%0A    for (int i = 0; i %3C num.length() / 2; i++) %7B%0A      for (int j = i + 1; j %3C num.length(); j++) %7B%0A        String a = num.substring(0, i + 1);%0A        String b = num.substring(i + 1, j + 1);%0A        String sum = num.substring(j + 1);%0A        if (!sum.isEmpty() && canStart(a) && canStart(b)) %7B%0A          if (additive(sum, Long.parseLong(a), Long.parseLong(b))) %7B%0A            return true;%0A          %7D%0A        %7D%0A      %7D%0A    %7D%0A    return false;%0A  %7D%0A%0A  private boolean canStart(String num) %7B%0A    return num.equals(%220%22) %7C%7C !num.startsWith(%220%22);%0A  %7D%0A%0A  private boolean additive(String str, long a, long b) %7B%0A    if (str.isEmpty()) return true;%0A    if (str.startsWith(%220%22)) return false;%0A    long sum = a + b;%0A    String strSum = %22%22 + sum;%0A    return str.startsWith(strSum) &&%0A      additive(str.substring(strSum.length()), b, sum);%0A  %7D%0A%7D%0A

add additive-number solution