@@ -0,0 +1,1176 @@
+package me.wayne.leetcodetop100;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0A/**%0A * %E5%B0%86%E4%B8%80%E4%B8%AA%E7%BB%99%E5%AE%9A%E5%AD%97%E7%AC%A6%E4%B8%B2 s %E6%A0%B9%E6%8D%AE%E7%BB%99%E5%AE%9A%E7%9A%84%E8%A1%8C%E6%95%B0 numRows %EF%BC%8C%E4%BB%A5%E4%BB%8E%E4%B8%8A%E5%BE%80%E4%B8%8B%E3%80%81%E4%BB%8E%E5%B7%A6%E5%88%B0%E5%8F%B3%E8%BF%9B%E8%A1%8C Z %E5%AD%97%E5%BD%A2%E6%8E%92%E5%88%97%E3%80%82%0A * %3Cp%3E%0A * https://leetcode-cn.com/problems/zigzag-conversion/%0A */%0Apublic class LC6_Convert %7B%0A%0A    public String convert(String s, int numRows) %7B%0A        if (numRows == 1) %7B%0A            return s;%0A        %7D%0A%0A        // ans%E4%BF%9D%E5%AD%98%E6%AF%8F%E4%B8%80%E8%A1%8C%E7%9A%84String%0A        List%3CList%3CCharacter%3E%3E ans = new ArrayList%3C%3E();%0A        for (int i = 0; i %3C numRows; i++) %7B%0A            ans.add(new ArrayList%3C%3E());%0A        %7D%0A%0A        boolean ordinal = true;%0A        int index = 0;%0A        for (int i = 0; i %3C s.length(); i++) %7B%0A            char ch = s.charAt(i);%0A            ans.get(index).add(ch);%0A            // %E6%AF%8F%E6%AC%A1%E5%88%B0%E5%BA%95%E6%88%96%E8%80%85%E5%88%B0%E9%A1%B6%E6%98%AF%E6%8D%A2%E4%B8%AA%E6%96%B9%E5%90%91%0A            if (i != 0 && i %25 (numRows - 1) == 0) %7B%0A                ordinal = !ordinal;%0A            %7D%0A            if (ordinal) %7B%0A                index++;%0A            %7D else %7B%0A                index--;%0A            %7D%0A        %7D%0A%0A        StringBuilder sb = new StringBuilder();%0A        for (List%3CCharacter%3E list : ans) %7B%0A            for (Character ch : list) %7B%0A                sb.append(ch);%0A            %7D%0A        %7D%0A        return sb.toString();%0A    %7D%0A%7D%0A

add LC6_Convert