2017年神雾杯全国大学生节能减排大赛三等奖作品
[leetcode]生成括号
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
给定n对括号,编写一个函数来生成格式正确的括号的所有组合。
[leetcode]ZigZag
The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)
P A H N
A P L S I I G
Y I R
And then read line by line: “PAHNAPLSIIGYIR”
Write the code that will take a string and make this conversion given a number of rows
字符串“PAYPALISHIRING”以Z字形图案写在给定数量的行上,如下所示:(您可能希望以固定字体显示此图案以获得更好的易读性)
然后逐行阅读:“PAHNAPLSIIGYIR”
编写将采用字符串的代码并在给定多行的情况下进行此转换
[leetcode]----最长回子串
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.
给出一个字符串,找到字符串中最长的回文串,你可以假设字符串的最大长度是1000