自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Leetcode 19

Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, the

2016-07-05 10:46:40 182

原创 Leetcode 26

Given a sorted array, remove the duplicates in place such that each element appear only once and returclass Solution { public: int removeDuplicates(vector& nums) { int size = nums.size();

2016-06-24 15:16:37 199

原创 Leetcode 88

Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note: You may assume that nums1 has enough space (size that is greater or equal to m + n) to hold add

2016-06-21 15:08:16 184

原创 Leetcode 144

Given a binary tree, return the preorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 \ 2 / 3 return [1,2,3]. /** * Definition for

2016-06-21 15:04:49 310

原创 Leetcode 94

Given a binary tree, return the inorder traversal of its nodes' values. For example: Given binary tree [1,null,2,3], 1 \ 2 / 3 return [1,3,2]. /** * Definition fo

2016-06-21 14:55:12 209

原创 Leetcode 83

Given a sorted linked list, delete all duplicates such that each element appear only once. For example, Given 1->1->2, return 1->2. Given 1->1->2->3->3, return 1->2->3. /** * Definition f

2016-04-11 14:54:22 231

原创 Leetcode 328

Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the nodes. You should try to do it in

2016-03-31 17:39:12 195

原创 Leetcode 13

Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. class Solution { public: int romanToInt(string s) { int m=0,i=0,j=0,k=0; whil

2016-03-31 14:38:56 160

原创 Leetcode 217

Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element

2016-03-30 11:46:14 154

原创 Leetcode 171

Related to question Excel Sheet Column Title Given a column title as appear in an Excel sheet, return its corresponding column number. For example: A -> 1 B -> 2 C -> 3 ..

2016-03-30 11:44:09 223

原创 Leetcode 169

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 that the array is non-empty and the majority element

2016-03-30 11:41:36 236

原创 Leetcode 206

Reverse a singly linked list. Recursion: /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * };

2016-03-30 11:36:01 236

空空如也

空空如也

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

TA关注的人

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