191.Fizz Buzz

题目 Write a program that outputs the string representation of numbers from 1 to n. But for multiples of three it should output “Fizz” instead of the n...

2019-05-07 21:18:22

阅读数 52

评论数 0

190.Largest Perimeter Triangle

题目 Given an array A of positive lengths, return the largest perimeter of a triangle with non-zero area, formed from 3 of these lengths. If it is impo...

2019-04-27 20:05:05

阅读数 124

评论数 0

189.Leaf-Similar Trees

题目 Consider all the leaves of a binary tree. From left to right order, the values of those leaves form a leaf value sequence.  For example, in the ...

2019-04-27 19:40:29

阅读数 62

评论数 0

188.Range Sum of BST

题目 Given the root node of a binary search tree, return the sum of values of all nodes with value between L and R (inclusive). The binary search tree ...

2019-04-26 22:42:17

阅读数 39

评论数 0

187.Base 7

题目 Given an integer, return its base 7 string representation. Example 1: Input: 100 Output: “202” Example 2: Input: -7 Output: “-10” Note: The input ...

2019-04-26 22:13:53

阅读数 50

评论数 0

186.Add Strings

题目 Given two non-negative integers num1 and num2 represented as string, return the sum of num1 and num2. Note: The length of both num1 and num2 is &a...

2019-04-24 20:37:15

阅读数 26

评论数 0

185.1-bit and 2-bit Characters

题目 We have two special characters. The first character can be represented by one bit 0. The second character can be represented by two bits (10 or 11...

2019-04-24 10:43:20

阅读数 36

评论数 0

184. Divisor Game

题目 Alice and Bob take turns playing a game, with Alice starting first. Initially, there is a number N on the chalkboard. On each player’s turn, that...

2019-04-23 21:41:20

阅读数 70

评论数 0

183.Univalued Binary Tree

题目 A binary tree is univalued if every node in the tree has the same value. Return true if and only if the given tree is univalued. Example 1: Input:...

2019-04-23 13:29:55

阅读数 37

评论数 0

182.Smallest Range II

参考 https://blog.csdn.net/zjucor/article/details/82820938 题目Given an array A of integers, for each integer A[i] we need to choose either x = -K or x =...

2019-04-22 22:52:27

阅读数 57

评论数 0

181.Smallest Range I

题目 Given an array A of integers, for each integer A[i] we may choose any x with -K <= x <= K, and add x to A[i]. After this process, we...

2019-04-21 17:13:31

阅读数 234

评论数 0

180.To Lower Case

题目 Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase. Example 1: Input: “Hello” Output: “hel...

2019-04-21 16:48:36

阅读数 42

评论数 0

179.Fibonacci Number

题目 The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding...

2019-04-21 16:30:26

阅读数 30

评论数 0

C++编译时出现 reference to local variable

具体见:https://stackoverflow.com/questions/19371137/c-reference-to-local-variable-returned 会引发问题的实现如下: vector<int> &amp...

2018-11-09 15:59:09

阅读数 463

评论数 0

atomic cas

2018-05-09 14:15:18

阅读数 359

评论数 0

178.Custom Sort String

题目 S and T are strings composed of lowercase letters. In S, no letter occurs more than once. S was sorted in some custom order previously. We want ...

2018-03-19 20:02:53

阅读数 182

评论数 0

177.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 ...

2018-03-19 19:35:49

阅读数 115

评论数 0

176.Judge Route Circle

题目 Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means it moves back to t...

2018-03-14 21:33:10

阅读数 95

评论数 0

java、C++、python三种语言对比之类 class

需求 实现一个简单的Student类, 属性 name age 方法 默认构造函数 带参数的构造函数 两个属性的get和set方法 测试,实现main方法 测试Student类中的方法都可以用 java定义一个Class public class Student { ...

2018-03-14 19:13:23

阅读数 1335

评论数 0

175.Maximum Binary Tree

题目 Given an integer array with no duplicates. A maximum tree building on this array is defined as follow: The root is the maximum number in the arr...

2018-03-14 18:28:31

阅读数 65

评论数 0

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