摘要:
Given a text file file.txt, transpose its content. You may assume that each row has the same number of columns and each field is separated by the ' ' 阅读全文
posted @ 2017-03-05 23:38
wilderness
阅读(215)
评论(0)
推荐(0)
摘要:
统计words.txt中每个单词出现的次数并排序 解法1: 解法2: 阅读全文
posted @ 2017-03-05 23:12
wilderness
阅读(138)
评论(0)
推荐(0)
摘要:
Given two strings s and t, write a function to determine if t is an anagram of s. For example,s = "anagram", t = "nagaram", return true.s = "rat", t = 阅读全文
posted @ 2017-03-05 21:29
wilderness
阅读(202)
评论(0)
推荐(0)
摘要:
Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the 阅读全文
posted @ 2017-03-05 21:09
wilderness
阅读(117)
评论(0)
推荐(0)
摘要:
确定一个数组中有没有重复的值,有的话返回真 解法1: 用python做这样的题感觉。。好简单啊 解法2: 排序,然后遍历 O(Nlog N) 阅读全文
posted @ 2017-03-05 20:38
wilderness
阅读(126)
评论(0)
推荐(0)
摘要:
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 阅读全文
posted @ 2017-03-05 20:30
wilderness
阅读(146)
评论(0)
推荐(0)
摘要:
统计小于n的素数的个数 如果判断每一个数是不是素数的话,时间会超时,如下 题意要统计素数的个数,那么可以换一种思路,每发现一个素数i,那么i^2,i^2+i...都肯定不是素数 阅读全文
posted @ 2017-03-05 19:41
wilderness
阅读(186)
评论(0)
推荐(0)
摘要:
转载自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 阅读全文
posted @ 2017-03-05 11:09
wilderness
阅读(229)
评论(0)
推荐(0)
摘要:
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 阅读全文
posted @ 2017-03-05 11:07
wilderness
阅读(139)
评论(0)
推荐(0)
摘要:
Given two integers representing the numerator and denominator of a fraction, return the fraction in string format. If the fractional part is repeating 阅读全文
posted @ 2017-03-05 08:49
wilderness
阅读(132)
评论(0)
推荐(0)
摘要:
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 阅读全文
posted @ 2017-03-05 00:03
wilderness
阅读(162)
评论(0)
推荐(0)

浙公网安备 33010602011771号