摘要: 问题: 求给定的两个字符串S1和S2是否 S1能经过以下变换得到S2。 若字符串长度为1,直接返回。 从任意index,进行切分,pre和post两部分, 可以选择:是否对这两部分进行交换。 然后,再将分割后的两部分,分别作为对象字符串,重复上述两个操作。 Example 1: Input: s1 阅读全文
posted @ 2021-03-22 17:50 habibah_chang 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 问题: 给定由 "(" 和 ")" 构成的字符串, 求其中完全匹配的子串,最长长度为多少。 Example 1: Input: s = "(()" Output: 2 Explanation: The longest valid parentheses substring is "()". Exam 阅读全文
posted @ 2021-03-22 16:04 habibah_chang 阅读(23) 评论(0) 推荐(0) 编辑
摘要: 问题: 爬楼梯问题。 给定n阶台阶,一次可以爬一阶or两阶。 求一共有多少种爬楼梯的方法。 Example 1: Input: n = 2 Output: 2 Explanation: There are two ways to climb to the top. 1. 1 step + 1 ste 阅读全文
posted @ 2021-03-22 14:38 habibah_chang 阅读(28) 评论(0) 推荐(0) 编辑