- 博客(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 166
原创 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 183
原创 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 159
原创 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 170
原创 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 138
原创 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 187
原创 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 134
原创 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 215
原创 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 163
原创 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 184
原创 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 171
原创 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 165
原创 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 198
原创 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 241
原创 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 175
原创 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 159
原创 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 149
原创 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 169
原创 学习中遇到的问题: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 2269
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人