排序:
默认
按更新时间
按访问量

LeetCode 383. Ransom Note

Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the ran...

2017-06-01 09:50:08

阅读数:127

评论数:0

LeetCode 599. Minimum Index Sum of Two Lists(map,unordered_map)

Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite restaurants represented by strings. You need to...

2017-05-31 19:53:03

阅读数:283

评论数:0

LeetCode 389. Find the Difference(异或)

Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more letter a...

2017-05-31 15:47:20

阅读数:99

评论数:0

LeetCode 349. Intersection of Two Arrays

Given two arrays, write a function to compute their intersection. Example: Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2]. Note: ...

2017-05-29 18:07:30

阅读数:87

评论数:0

LeetCode 455. Assign Cookies(数组,排序)

Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a ...

2017-05-29 17:34:10

阅读数:115

评论数:0

LeetCode 100. Same Tree(二叉树)

Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identical...

2017-05-29 11:02:42

阅读数:184

评论数:0

LeetCode 404. Sum of Left Leaves(二叉树)

Find the sum of all left leaves in a given binary tree. Example: 3 / \ 9 20 / \ 15 7 There are two left leaves in the bi...

2017-05-29 10:23:15

阅读数:78

评论数:0

LeetCode 167. Two Sum II - Input array is sorted(有序数组夹逼法)

Total Accepted: 74198Total Submissions: 157252Difficulty: EasyContributor: LeetCode Given an array of integers that is already sorted in ascending...

2017-05-29 09:46:42

阅读数:147

评论数:0

LeetCode 283. Move Zeroes

Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. For exampl...

2017-05-28 22:31:47

阅读数:77

评论数:0

LeetCode 258. Add Digits(1+(n-1)%9)

Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the process...

2017-05-28 22:06:51

阅读数:100

评论数:0

LeetCode 371. Sum of Two Integers

Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. Example: Given a = 1 and b = 2, return 3. 思路: ...

2017-05-28 21:09:54

阅读数:108

评论数:0

子数组和问题,和被某个数整除

1. 子数组和问题,和被元素个数整除     和被某个元素整除 2. 子数组和问题,和被10整除     和被10整除

2017-05-28 20:12:57

阅读数:370

评论数:0

越狱(快速幂取模)

问题描述: 监狱有连续编号为1...N的N个房间,每个房间关押一个犯人,有M种宗教,每个犯人可能信仰其中一种。如果相邻房间的犯人的宗教相同,就可能发生越狱,求有多少种状态可能发生越狱。 输入: 输入两个整数M,N.1 输出: 可能越狱的状态数,模100003取余 例子输入: 2 3 ...

2017-05-28 18:56:44

阅读数:218

评论数:0

LeetCode 171. Excel Sheet Column Number(进制转换)

Related to question Excel Sheet Column Title Given a column title as appear in an Excel sheet, return its corresponding column number. For exam...

2017-05-27 20:42:05

阅读数:91

评论数:0

LeetCode 387. First Unique Character in a String(unordered_map元素顺序杂乱性)

Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. Examples: s = "leetcode&quo...

2017-05-27 20:09:07

阅读数:77

评论数:0

LeetCode 169. Majority Element

Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume th...

2017-05-27 12:33:35

阅读数:65

评论数:0

LeetCode 242. Valid Anagram(字谜)

Total Accepted: 153072Total Submissions: 333862Difficulty: EasyContributor: LeetCode Given two strings s and t, write a function to determine if t ...

2017-05-26 21:58:04

阅读数:201

评论数:0

LeetCode 448. Find All Numbers Disappeared in an Array(查找数组中没有出现的数字)

Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements of [1,...

2017-05-26 21:06:27

阅读数:105

评论数:0

LeetCode 409. Longest Palindrome(最长回文)

Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters. ...

2017-05-26 20:49:34

阅读数:275

评论数:1

LeetCode 520:Detect Capital

Given a word, you need to judge whether the usage of capitals in it is right or not. We define the usage of capitals in a word to be right when one ...

2017-05-26 18:25:50

阅读数:164

评论数:0

提示
确定要删除当前文章?
取消 删除
关闭
关闭