
leetcode
文章平均质量分 59
YYlxid
这个作者很懒,什么都没留下…
展开
-
318. Maximum Product of Word Lengths
Given a string array words, find themaximum value of length(word[i]) * length(word[j]) wherethe two words do not share common letters. You may assume that each word willcontain only lower case let原创 2016-02-22 09:16:07 · 485 阅读 · 0 评论 -
260. Single Number III
Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once.For example:Given nums原创 2016-02-26 08:47:57 · 399 阅读 · 0 评论 -
238. Product of Array Except Self
Given an array of n integerswhere n > 1, nums, return an array output suchthat output[i] is equal to the product of all theelements of nums except nums[i].Solve it withoutdivision and in O(n).Fo原创 2016-02-29 08:29:41 · 384 阅读 · 0 评论 -
242. Valid Anagram
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 = "car", return false.Note:You may assume the原创 2016-02-29 08:31:03 · 408 阅读 · 0 评论 -
299. Bulls and Cows
You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what the number is. Each time your friend makes a guess, you provide a hint that原创 2016-04-14 19:56:23 · 418 阅读 · 0 评论 -
290. Word Pattern
Given a pattern and a string str, find if str follows the same pattern.Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty word in str.Examples:原创 2016-04-14 20:53:38 · 388 阅读 · 0 评论 -
303. Range Sum Query - Immutable
Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.Example: Given nums = [-2, 0, 3, -5, 2, -1]sumRange(0, 2) -> 1 sumRange(2, 5) -> -1 sumRange(0, 5原创 2016-04-14 21:26:34 · 442 阅读 · 0 评论