摘要:
类似解法问题(index符号标记法) 442. Find All Duplicates in an Array 448. Find All Numbers Disappeared in an Array 问题: 给定size=n的数组,记录1~n。 其中存在某个数字重复,占用另一个数字的空间,导致漏 阅读全文
摘要:
问题: 给定字符串s,匹配串t 求s中匹配t的方法有多少种。 匹配:s中存在t的序列。 Example 1: Input: s = "rabbbit", t = "rabbit" Output: 3 Explanation: As shown below, there are 3 ways you 阅读全文
摘要:
问题: 求a^b%base的值。 a为int型数 b为int数组,例如[1,2,3,4]代表:b=1234 base=1337。 Example 1: Input: a = 2, b = [3] Output: 8 Example 2: Input: a = 2, b = [1,0] Output: 阅读全文
摘要:
问题: 求从0 到 小于给定n 的正整数中,有多少个素数(质数)。 素数:只能被 自己 和 1 整除。(1和0不是) Example 1: Input: n = 10 Output: 4 Explanation: There are 4 prime numbers less than 10, the 阅读全文