自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 219. Contains Duplicate II

题目:Given an array of integers and an integer k, find out whether there are two distinct indices iand j in the array such that nums[i] = nums[j] and the difference between i and j is at mostk

2016-11-08 23:39:49 149

原创 88. Merge Sorted Array

题目: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 h

2016-11-08 23:35:18 171

原创 169. Majority Element

题目: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

2016-11-08 23:29:27 148

原创 64. Minimum Path Sum

题目:Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.Note: You can only move either down or

2016-11-08 23:22:15 156

原创 448. Find All Numbers Disappeared in an Array

题目:Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.Find all the elements of [1, n] inclusive that do not appear in this a

2016-11-07 23:26:39 126

原创 167. Two Sum II - Input array is sorted

题目:Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the t

2016-11-07 23:17:21 163

原创 402.Remove K Digits

题目:Given a non-negative integer num represented as a string, remove k digits from the number so that the new number is the smallest possible.Note:The length of num is less than 10002 a

2016-10-16 16:51:48 124

原创 71.Simplify Path

题目:Given an absolute path for a file (Unix-style), simplify it.For example,path = "/home/", => "/home"path = "/a/./b/../../c/", => "/c"思路:1、边界情况:如果只输入'/':直接返回"/"即可2、做这道题需

2016-10-16 11:45:19 200

原创 234. Palindrome Linked List

题目:Given a singly linked list, determine if it is a palindrome.Follow up:Could you do it in O(n) time and O(1) space?题目分析:1、边界情况:链表为空或者链表长度为12、判断回文方法:将后半段翻转,与前半段比较,相同即回文思路:

2016-10-08 14:18:39 152

原创 86. Partition List

题目:Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.You should preserve the original relative order of the nodes i

2016-10-04 19:54:02 171

原创 82. Remove Duplicates from Sorted List II

题目:Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.For example,Given 1->2->3->3->4->4->5, return 1->2->5.Gi

2016-10-04 19:33:52 159

原创 61. Rotate List

题目:Given a list, rotate the list to the right by k places, where k is non-negative.For example:Given 1->2->3->4->5->NULL and k = 2,return 4->5->1->2->3->NULL.题目分析:1、边界情况:k

2016-10-04 19:25:10 149

原创 328. Odd Even Linked List

题目: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

2016-10-04 18:01:36 181

原创 2. Add Two Numbers

题目:You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return

2016-10-04 17:41:08 230

原创 92. Reverse Linked List II

题目:Reverse a linked list from position m to n. Do it in-place and in one-pass.For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4,return 1->4->3->2->5->NULL.Note:Given m, n sa

2016-10-04 17:29:31 163

原创 142. Linked List Cycle II

题目:Given a linked list, return the node where the cycle begins. If there is no cycle, return null.Note: Do not modify the linked list.题目分析:1、边界情况:量表为空;只有一个节点,指向本节点2、必须先知道链表存在不存在环(快慢指

2016-10-04 16:25:22 147

原创 143. Reorder List

题目:Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' values.For example,Given {1,2,3,4}, reord

2016-10-02 10:48:52 137

原创 160. Intersection of Two Linked Lists

题目:Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: a1 → a2 ↘

2016-10-02 10:23:25 155

原创 django中文字符问题

UnicodeDecodeError

2016-09-24 18:10:05 1326

原创 学习中遇到的问题:RemovedInDjango110Warning: SuppRemovedInDjango110Warning:

刚开始学习Django框架,遇到了版本更新带来的问题。所学教程中Django版本为1.6,而我电脑中Django版本为1.10。在教程中,定义视图函数相关的url.py中,需要关联新建app中view中的index函数,所给我出的实例代码为from django.conf.urls import patterns, include, urlfrom django.contrib i

2016-09-24 16:21:02 2251

空空如也

空空如也

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

TA关注的人

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