摘要:
给定两个字符串,判断其是否是同构的。何为同构,即字符串中每个字符都是单一映射的。Input: s = "egg", t = "add"Output: true Input: s = "foo", t = "bar"Output: false 思路:设置两个哈希字典,一个保存s到t的映射,另一个保存t 阅读全文
摘要:
给定一个正整数,求小于这个数的质数个数。Input: 10Output: 4Explanation: There are 4 prime numbers less than 10, they are 2, 3, 5, 7. 思路:一、暴力,利用for循环,对 2~n的数遍历,当遇到质数时,将其加入动 阅读全文