- 博客(13)
- 收藏
- 关注
原创 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 at a random position. Find the letter that was ad
2017-07-14 19:19:08 251
原创 344. Reverse String
Write a function that takes a string as input and returns the string reversed. Example: Given s = "hello", return "olleh". 解题思路:很简单的逆转题 class Solution { public: void my_swap(char *s, cha
2017-07-14 18:59:31 156
原创 463. Island Perimeter
You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid is completely
2017-07-14 10:18:57 149
原创 557. Reverse Words in a String III
Given a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order. Example 1: Input: "Let's take LeetCode contest"
2017-07-14 09:55:04 236
原创 500. Keyboard Row
Given a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyboard like the image below. Example 1: Input: ["Hello", "Alaska", "Dad
2017-07-14 09:45:31 192
原创 637. Average of Levels in Binary Tree
Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array. Example 1: Input: 3 / \ 9 20 / \ 15 7 Output: [3, 14.5, 11] Explanat
2017-07-12 10:54:22 259
原创 476. Number Complement
Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Note: The given integer is guaranteed to fit within the range of
2017-07-12 08:25:47 134
原创 595. Big Countries
There is a table World +-----------------+------------+------------+--------------+---------------+ | name | continent | area | population | gdp | +-----------------+--
2017-07-11 12:16:30 348
原创 561. Array Partition I
Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of min(ai, bi) for all i from 1 to n as large as pos
2017-07-11 09:18:42 129
原创 617. Merge Two Binary Trees
Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not. You need to merge them into a new binary tr
2017-07-11 08:51:43 260
原创 461. Hamming Distance
The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calculate the Hamming distance. Note: 0 ≤ x, y 31.
2017-07-10 09:18:44 135
原创 1. Two Sum
Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the same
2017-07-10 08:42:01 169
原创 414. Third Maximum Number
Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time complexity must be in O(n). Example 1: Input: [3, 2,
2017-02-26 20:59:48 130
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人