@@ -0,0 +1,1357 @@
+package leetcode;%0A%0Aimport java.util.regex.Matcher;%0Aimport java.util.regex.Pattern;%0A%0A/**%0A * https://leetcode.com/problems/reformat-date/%0A */%0Apublic class Problem1507 %7B%0A    public String reformatDate(String date) %7B%0A        String%5B%5D split = date.split(%22 %22);%0A        Matcher m = Pattern.compile(%22(%5C%5Cd+)%5C%5Cw+%22).matcher(split%5B0%5D);%0A        m.matches();%0A        return split%5B2%5D + %22-%22 + getMonth(split%5B1%5D) + %22-%22 + getDay(m.group(1));%0A    %7D%0A%0A    private static String getDay(String day) %7B%0A        return day.length() == 1 ? %220%22 + day : day;%0A    %7D%0A%0A    private static String getMonth(String month) %7B%0A        if (month.equals(%22Jan%22)) %7B%0A            return %2201%22;%0A        %7D else if (month.equals(%22Feb%22)) %7B%0A            return %2202%22;%0A        %7D else if (month.equals(%22Mar%22)) %7B%0A            return %2203%22;%0A        %7D else if (month.equals(%22Apr%22)) %7B%0A            return %2204%22;%0A        %7D else if (month.equals(%22May%22)) %7B%0A            return %2205%22;%0A        %7D else if (month.equals(%22Jun%22)) %7B%0A            return %2206%22;%0A        %7D else if (month.equals(%22Jul%22)) %7B%0A            return %2207%22;%0A        %7D else if (month.equals(%22Aug%22)) %7B%0A            return %2208%22;%0A        %7D else if (month.equals(%22Sep%22)) %7B%0A            return %2209%22;%0A        %7D else if (month.equals(%22Oct%22)) %7B%0A            return %2210%22;%0A        %7D else if (month.equals(%22Nov%22)) %7B%0A            return %2211%22;%0A        %7D%0A        return %2212%22;%0A    %7D%0A%7D%0A

Solve problem 1507