package leetcode;

/**
 * https://leetcode.com/problems/replace-all-digits-with-characters/
 */
public class Problem1844 {
    public String replaceDigits(String s) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
        Problem1844 prob = new Problem1844();
        System.out.println(prob.replaceDigits("a1c1e1")); // "abcdef"
        System.out.println(prob.replaceDigits("a1b2c3d4e")); // "abbdcfdhe"
    }
}

@@ -172,280 +172,410 @@
     
-// TODO%0A        return null;
+StringBuilder answer = new StringBuilder();%0A        for (int i = 0; i %3C s.length(); i++) %7B
 %0A    
-%7D%0A%0A
     
-public static void main(String%5B%5D args) %7B%0A        Problem1844 prob = new Problem1844();%0A        System.out.println(prob.replaceDigits(%22a1c1e1%22)); // %22abcdef%22%0A        System.out.println(prob.replaceDigits(%22a1b2c3d4e%22)); // %22abbdcfdhe%22
+    if (i %25 2 == 0) %7B%0A                answer.append(s.charAt(i));%0A            %7D else %7B%0A                answer.append(shift(s.charAt(i - 1), s.charAt(i) - '0'));%0A            %7D%0A        %7D%0A        return answer.toString();%0A    %7D%0A%0A    private static char shift(char c, int x) %7B%0A        return (char) (c + x);
 %0A   

Solve problem 1844