自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(54)
  • 收藏
  • 关注

原创 leetcode:257 Binary Tree Paths-每日编程第四十五题

Binary Tree PathsTotal Accepted: 27476 Total Submissions: 108456 Difficulty: EasyGiven a binary tree, return all root-to-leaf paths.For example, given the following binary tree:

2015-12-29 14:48:47 486

原创 leetcode:234 Palindrome Linked List-每日编程第四十四题

Palindrome Linked ListTotal Accepted: 31409 Total Submissions: 122659 Difficulty: EasyGiven a singly linked list, determine if it is a palindrome.Follow up:Could you do it in O(n)

2015-12-29 13:50:05 377

原创 leetcode:67 Add Binary-每日编程第四十三题

Add BinaryTotal Accepted: 67578 Total Submissions: 261262 Difficulty: EasyGiven two binary strings, return their sum (also a binary string).For example,a = "11"b = "1"Return "1

2015-12-29 11:22:31 388

原创 leetcode:14 Longest Common Prefix-每日编程第四十二题

Longest Common PrefixTotal Accepted: 78873 Total Submissions: 295144 Difficulty: EasyWrite a function to find the longest common prefix string amongst an array of strings.class Solut

2015-12-29 11:15:26 324

原创 leetcode:299 Bulls and Cows-每日编程第四十一题

Bulls and CowsTotal Accepted: 12776 Total Submissions: 47566 Difficulty: EasyYou are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend

2015-12-29 11:13:21 504

原创 leetcode:203 Remove Linked List Elements-每日编程第四十题

Remove Linked List ElementsTotal Accepted: 44897 Total Submissions: 165785 Difficulty: EasyRemove all elements from a linked list of integers that have value val.ExampleGiven: 1 --

2015-12-28 21:46:48 297

原创 leetcode:290 Word Pattern-每日编程第三十九题

Word PatternTotal Accepted: 19405 Total Submissions: 71219 Difficulty: EasyGiven a pattern and a string str, find if str follows the same pattern.Here follow means a full match, such

2015-12-28 20:19:28 319

原创 leetcode:205 Isomorphic Strings-每日编程第三十八题

Isomorphic StringsTotal Accepted: 39963 Total Submissions: 145129 Difficulty: EasyGiven two strings s and t, determine if they are isomorphic.Two strings are isomorphic if the charac

2015-12-28 19:54:58 276

原创 leetcode:20 Valid Parentheses-每日编程第三十七题

Valid ParenthesesTotal Accepted: 84022 Total Submissions: 301663 Difficulty: EasyGiven a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input s

2015-12-26 20:48:19 297

原创 leetcode:19 Remove Nth Node From End of List-每日编程第三十六题

Remove Nth Node From End of ListTotal Accepted: 86119 Total Submissions: 307466 Difficulty: EasyGiven a linked list, remove the nth node from the end of list and return its head.For

2015-12-26 20:33:47 277

原创 leetcode:219 Contains Duplicate II-每日编程第三十五题

Contains Duplicate IITotal Accepted: 38552 Total Submissions: 137098 Difficulty: EasyGiven an array of integers and an integer k, find out whether there are two distinct indices i and j in

2015-12-26 19:52:44 312

原创 leetcode:58 Length of Last Word-每日编程第三十四题

Length of Last WordTotal Accepted: 76106 Total Submissions: 269840 Difficulty: EasyGiven a string s consists of upper/lower-case alphabets and empty space characters ' ', return the le

2015-12-26 19:35:25 284

原创 leetcode:223 Rectangle Area-每日编程第三十三题

Valid SudokuTotal Accepted: 25744 Total Submissions: 91222 Difficulty: EasyFind the total area covered by two rectilinear rectangles in a 2D plane.Each rectangle is defined by it

2015-12-24 16:52:12 385

原创 leetcode:190 Reverse Bits-每日编程第三十二题

Reverse BitsTotal Accepted: 46760 Total Submissions: 160246 Difficulty: EasyReverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary

2015-12-24 16:03:58 347

原创 leetcode:88 Merge Sorted Array-每日编程第三十一题

Merge Sorted ArrayTotal Accepted: 80108 Total Submissions: 271926 Difficulty: EasyGiven two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.思路:

2015-12-24 15:58:05 270

原创 leetcode:111 Minimum Depth of Binary Tree-每日编程第三十题

Minimum Depth of Binary TreeTotal Accepted: 84968 Total Submissions: 285784 Difficulty: EasyGiven a binary tree, find its minimum depth.The minimum depth is the number of nodes along

2015-12-24 15:35:30 266

原创 leetcode:160 Intersection of Two Linked Lists-每日编程第二十九题

Intersection of Two Linked ListsTotal Accepted: 53988 Total Submissions: 181510 Difficulty: EasyWrite a program to find the node at which the intersection of two singly linked lists begi

2015-12-15 22:17:55 271

原创 leetcode:9 Palindrome Number-每日编程第二十八题

Palindrome NumberTotal Accepted: 95160 Total Submissions: 317694 Difficulty: EasyDetermine whether an integer is a palindrome. Do this without extra space.思路:1).使用while(x/10>base),而不是while

2015-12-15 21:45:21 425

原创 leetcode:112 Path Sum-每日编程第二十七题

Path SumTotal Accepted: 81534 Total Submissions: 268857 Difficulty: EasyGiven a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values alon

2015-12-15 21:14:25 267

原创 leetcode:225 Implement Stack using Queues-每日编程第二十六题

Binary Tree Level Order TraversalTotal Accepted: 25331 Total Submissions: 83601 Difficulty: EasyImplement the following operations of a stack using queues.push(x) -- Push element

2015-12-15 21:01:37 422

原创 leetcode:119 Pascal's Triangle II-每日编程第二十五题

Pascal's Triangle IITotal Accepted: 60120 Total Submissions: 196457 Difficulty: EasyGiven an index k, return the kth row of the Pascal's triangle.For example, given k = 3,Return [1

2015-12-15 20:42:21 257

原创 leetcode:172 Factorial Trailing Zeroes-每日编程第二十四题

Factorial Trailing ZeroesTotal Accepted: 44351 Total Submissions: 144160 Difficulty: EasyGiven an integer n, return the number of trailing zeroes in n!.Note: Your solution should be

2015-12-15 20:32:12 335

原创 C++11 学习笔记 右值引用

一.右值引用C++11增加了一个新的类型,称为右值引用(R-value reference),标记为T &&。右值是指表达式结束后就不再存在的临时对象。相对应的左值就是指表达式结束后依然存在的持久对象,所有的具名变量或对象都是左值,而右值不具名。一个区分左值与右值的便捷方法是:看能不能对表达式取地址,如果能,则为左值。在C++11中,右值由两个概念构成,一个是将亡值(xvalue,expi

2015-12-15 09:59:57 725

原创 leetcode:118 Pascal's Triangle-每日编程第二十四题

Pascal's TriangleTotal Accepted: 66425Total Submissions: 210900Difficulty: EasyGiven numRows, generate the first numRows of Pascal's triangle.For example, given numRows = 5,Return[

2015-12-13 21:50:46 216

原创 leetcode:26 Remove Duplicates from Sorted Array-每日编程第二十三题

Remove Duplicates from Sorted ArrayTotal Accepted: 98385 Total Submissions:307605 Difficulty:EasyGiven a sorted array, remove the duplicates in place such that each element appear only

2015-12-13 21:32:53 356

原创 leetcode:198 House Robber-每日编程第二十二题

House RobberTotal Accepted: 44999Total Submissions: 140629 Difficulty: EasyYou are a professional robber planning to rob houses along a street. Each house has a certain amount of money sta

2015-12-13 10:54:42 543

原创 C++11 学习笔记 列表初始化

一.列表初始化1.在C++98/03中,只有普通数组和POD类型(plain old data类型,可以直接使用memcpy复制的对象)可以用初始化列表来进行初始化。int i_arr[3] = { 1, 2, 3 };long l_arr[3] = { 1, 3, 2, 4 };struct A{ int x; int y;} a = { 1, 2 };

2015-12-11 18:51:01 789

原创 leetcode:27 Remove Element-每日编程第二十一题

Remove ElementTotal Accepted: 89646 Total Submissions: 276815 Difficulty: EasyGiven an array and a value, remove all instances of that value in place and return the new length.The or

2015-12-11 11:52:09 294

原创 leetcode:101 Symmetric Tree-每日编程第二十题

Symmetric TreeTotal Accepted: 83908 Total Submissions: 257485 Difficulty: EasyGiven a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For exampl

2015-12-11 11:10:29 470

原创 leetcode:110 Balanced Binary Tree-每日编程第十九题

Balanced Binary TreeTotal Accepted: 85721 Total Submissions: 261445 Difficulty: EasyGiven a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary

2015-12-11 10:46:13 247

原创 leetcode:231 Power of Two-每日编程第十八题

Power of TwoTotal Accepted: 42645 Total Submissions: 128399 Difficulty: EasyGiven an integer, write a function to determine if it is a power of two.思路:1).0可不是2的阶乘,因此,要在函数头判断输入是否为0。2).如果n

2015-12-11 10:34:40 191

原创 leetcode:21 Merge Two Sorted Lists-每日编程第十七题

Merge Two Sorted ListsTotal Accepted: 95133 Total Submissions: 281996 Difficulty: EasyMerge two sorted linked lists and return it as a new list. The new list should be made by splicing togethe

2015-12-11 10:14:35 237

原创 leetcode:232 Implement Queue using Stacks-每日编程第十六题

Implement Queue using StacksTotal Accepted: 26279 Total Submissions: 77749 Difficulty: EasyImplement the following operations of a queue using stacks.push(x) -- Push element x to the

2015-12-11 10:06:12 206

原创 C++11 学习笔记 模板的细节(右尖括号,using,函数模板默认参数)

一.模板的右尖括号在C++98/03的泛型编程中,模板实例化有一个很繁琐的地方,就是连续两个右尖括号(>>)会被编译解释成右移操作符,而不是模板参数表的形式。即template struct Foo{ typedef T type;};template class A{ // ....};int main(){ Foo>::type xx;/

2015-12-10 19:35:53 5112

原创 leetcode:70 Climbing Stairs-每日编程第十五题

Climbing StairsTotal Accepted: 83180 Total Submissions: 234611 Difficulty: EasyYou are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or

2015-12-10 14:42:01 269

原创 leetcode:206 Reverse Linked List-每日编程第十四题

Reverse Linked ListTotal Accepted: 65133 Total Submissions: 179691 Difficulty: EasyReverse a singly linked list.Hint:A linked list can be reversed either iteratively or recursive

2015-12-10 14:41:28 216

原创 leetcode:191 Number of 1 Bits-每日编程第十三题

Number of 1 BitsTotal Accepted: 63943 Total Submissions: 169155 Difficulty: EasyWrite a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as t

2015-12-10 14:40:53 251

原创 leetcode:235 Lowest Common Ancestor of a Binary Search Tree-每日编程第十二题

Lowest Common Ancestor of a Binary Search TreeTotal Accepted: 41013 Total Submissions: 108082 Difficulty: Easy Given a binary search tree (BST), find the lowest common ancestor (LC

2015-12-10 14:40:09 208

原创 leetcode:169 Majority Element-每日编程第十一题

Majority ElementTotal Accepted: 78809 Total Submissions: 206122 Difficulty: EasyGiven an array of size n, find the majority element. The majority element is the element that appears mo

2015-12-10 14:39:32 310

原创 leetcode:171 Excel Sheet Column Number-每日编程第十题

Excel Sheet Column NumberTotal Accepted: 54683 Total Submissions: 140674 Difficulty: Easy Given a column title as appear in an Excel sheet, return its corresponding column number.

2015-12-10 14:38:48 189

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

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