上一页 1 ··· 6 7 8 9 10

2019年2月17日

摘要: Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Example: Inpu 阅读全文
posted @ 2019-02-17 00:20 一直走在路上 阅读(157) 评论(0) 推荐(0)

2019年2月12日

摘要: Given an array of integers A sorted in non-decreasing order, return an array of the squares of each number, also in sorted non-decreasing order. Examp 阅读全文
posted @ 2019-02-12 04:27 一直走在路上 阅读(125) 评论(0) 推荐(0)

2019年2月10日

摘要: The above elevation map is represented by array [0,1,0,2,1,0,1,3,2,1,2,1]. In this case, 6 units of rain water (blue section) are being trapped. Thank 阅读全文
posted @ 2019-02-10 06:03 一直走在路上 阅读(124) 评论(0) 推荐(0)

2019年2月9日

摘要: This question is the same as "Max Chunks to Make Sorted" except the integers of the given array are not necessarily distinct, the input array could be 阅读全文
posted @ 2019-02-09 20:22 一直走在路上 阅读(139) 评论(0) 推荐(0)
摘要: Given an array arr that is a permutation of [0, 1, ..., arr.length - 1], we split the array into some number of "chunks" (partitions), and individuall 阅读全文
posted @ 2019-02-09 19:15 一直走在路上 阅读(120) 评论(0) 推荐(0)

2019年2月4日

摘要: Given a collection of distinct integers, return all possible permutations. Example: Input: [1,2,3] Output: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1, 阅读全文
posted @ 2019-02-04 23:23 一直走在路上 阅读(113) 评论(0) 推荐(0)

2019年2月3日

摘要: The set [1,2,3,...,n] contains a total of n! unique permutations. By listing and labeling all of the permutations in order, we get the following seque 阅读全文
posted @ 2019-02-03 05:11 一直走在路上 阅读(114) 评论(0) 推荐(0)

2019年2月1日

摘要: Similar to next permutation, the steps as follow: 1) Find k in the increasing suffix such that nums[k] > nums[k+1], if there is no such element, the p 阅读全文
posted @ 2019-02-01 05:42 一直走在路上 阅读(155) 评论(0) 推荐(0)
摘要: Leetcode 31 Next permutation [6, 2, 1, 5, 4 3] -> [6, 2, 3, 1, 4, 5] [0, 1, 2] -> [0, 2, 1] [2, 1, 0] -> [0, 1, 2] 1) Find the key k such that nums[k] 阅读全文
posted @ 2019-02-01 04:33 一直走在路上 阅读(160) 评论(0) 推荐(0)

2018年4月12日

摘要: 2018-04-15 在Python 里面加标注, 发现Vim强大的两种用法, 比如要在1-5行加标注: 1. 用寻找和替代(basic search and replace),:1, 5s/^/# 2. 用Visual Block, Ctrl + c -> highlight 1-5 lines 阅读全文
posted @ 2018-04-12 05:52 一直走在路上 阅读(166) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10

导航