- 博客(15)
- 收藏
- 关注
原创 393. UTF-8 Validation
A character in UTF8 can be from 1 to 4 bytes long, subjected to the following rules:For 1-byte character, the first bit is a 0, followed by its unicode code.For n-bytes character, the first n-bits
2017-06-30 11:49:00 209
原创 575. Distribute Candies
Given an integer array with even length, where different numbers in this array represent differentkinds of candies. Each number means one candy of the corresponding kind. You need to distribute thes
2017-06-28 21:02:08 164
原创 150. Evaluate Reverse Polish Notation
Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or another expression.Some examples: ["2", "1", "
2017-06-22 23:38:48 195
原创 125. Valid Palindrome
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Panama" is a palindrome."race a car" is not a
2017-06-22 12:38:06 181
原创 38. Count and Say
The count-and-say sequence is the sequence of integers with the first five terms as following:1. 12. 113. 214. 12115. 1112211 is read off as "one 1" or 11.11 is read off
2017-06-22 12:21:02 705
原创 77. Combinations
Given two integers n and k, return all possible combinations ofk numbers out of 1 ... n.For example,If n = 4 and k = 2, a solution is:[ [2,4], [3,4], [2,3], [1,2], [1,3], [1,4],]
2017-06-20 23:25:28 172
原创 459. Repeated Substring Pattern
Given a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. You may assume the given string consists of lowercase Engli
2017-06-19 22:03:22 176
原创 445. Add Two Numbers II
You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contain a single digit. Add the two numbers and return i
2017-06-18 22:53:33 241
原创 538. Convert BST to Greater Tree
Given a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus sum of all keys greater than the original key in BST.Exampl
2017-06-18 12:46:55 230
原创 561. Array Partition I
Given an array of 2n integers, your task is to group these integers inton 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-06-18 11:59:31 207
原创 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-06-16 19:59:35 373
原创 535. Encode and Decode TinyURL
TinyURL is a URL shortening service where you enter a URL such as https://leetcode.com/problems/design-tinyurl and it returns a short URL such as http://tinyurl.com/4e9iAk.Design the encode and de
2017-06-16 00:04:58 498
原创 31. Next Permutation
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest possible
2017-06-15 17:30:23 250
原创 6. ZigZag Conversion
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H NA P L S I
2017-06-15 16:46:00 214
原创 5. Longest Palindromic Substring
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example:Input: "babad"Output: "bab"Note: "aba" is also a valid answer.
2017-06-15 15:58:01 186
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人