摘要:
Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t. All occurrenc 阅读全文
摘要:
统计小于n的素数的个数 如果判断每一个数是不是素数的话,时间会超时,如下 题意要统计素数的个数,那么可以换一种思路,每发现一个素数i,那么i^2,i^2+i...都肯定不是素数 阅读全文
摘要:
转载自leetcode评论区:https://discuss.leetcode.com/topic/30941/here-is-a-10-line-template-that-can-solve-most-substring-problems I will first give the soluti 阅读全文
摘要:
Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). For example,S = "ADOBECOD 阅读全文
摘要:
Given two integers representing the numerator and denominator of a fraction, return the fraction in string format. If the fractional part is repeating 阅读全文
摘要:
Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process: Starting with any positive intege 阅读全文