- 博客(15)
- 收藏
- 关注
原创 646. Maximum Length of Pair Chain
You are given n pairs of numbers. In every pair, the first number is always smaller than the second number. Now, we define a pair (c, d) can follow another pair (a, b) if and only if b . Chain
2017-07-28 14:10:17 461
转载 defer和async的区别
原帖地址:https://segmentfault.com/q/1010000000640869 先来试个一句话解释仨,当浏览器碰到 script 脚本的时候: 没有 defer 或 async,浏览器会立即加载并执行指定的脚本,“立即”指的是在渲染该 script 标签之下的文档元素之前,也就是说不等待后续载入的文档元素,读到就加载并执行。 有 async,加载
2017-07-26 18:03:34 263
原创 django创建一个新项目以及创建一个新的应用
创建一个新的Django项目 在你的喜欢的目录下打开终端命令行,输入 python django-admin.py startproject 其中是你想要创建项目的名字 创建一个新的Django应用 1、进入你创建的项目的目录,打开终端命令行,输入 python manage.py startapp 其中是你想要创建应用的名字 2、告诉你的Django项目that你
2017-07-24 11:38:30 645
原创 560. Subarray Sum Equals K
Given an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to k. Example 1: Input:nums = [1,1,1], k = 2 Output: 2 Note: The le
2017-07-20 21:49:17 324
原创 216. Combination Sum III
Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be a unique set of numbers. Example 1: Input:
2017-07-19 10:21:43 209
原创 643. Maximum Average Subarray I
Given an array consisting of n integers, find the contiguous subarray of given length k that has the maximum average value. And you need to output the maximum average value. Example 1: Input:
2017-07-18 11:51:16 531
原创 637. Average of Levels in Binary Tree
Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array. Example 1: Input: 3 / \ 9 20 / \ 15 7 Output: [3, 14.5, 11] Explanat
2017-07-18 11:40:16 203
原创 501. Find Mode in Binary Search Tree
Given a binary search tree (BST) with duplicates, find all the mode(s) (the most frequently occurred element) in the given BST. Assume a BST is defined as follows: The left subtree of a node c
2017-07-17 16:46:10 232
原创 523. Continuous Subarray Sum
Given a list of non-negative numbers and a target integer k, write a function to check if the array has a continuous subarray of size at least 2 that sums up to the multiple of k, that is, sums up t
2017-07-14 13:28:49 209
原创 628. Maximum Product of Three Numbers
Given an integer array, find three numbers whose product is maximum and output the maximum product. Example 1: Input: [1,2,3] Output: 6 Example 2: Input: [1,2,3,4] Output: 24 Note:
2017-07-14 10:10:19 265
原创 221. Maximal Square
Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. For example, given the following matrix: 1 0 1 0 0 1 0 1 1 1 1 1 1 1 1 1 0 0 1 0
2017-07-13 22:57:03 170
原创 494. Target Sum
You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose one from + and - as its new symbol. Find out h
2017-07-13 15:29:15 224
原创 623. Add One Row to Tree
Given the root of a binary tree, then value v and depth d, you need to add a row of nodes with value v at the given depth d. The root node is at depth 1. The adding rule is: given a positive inte
2017-07-13 10:28:14 234
原创 91. Decode Ways
A message containing letters from A-Z is being encoded to numbers using the following mapping: 'A' -> 1 'B' -> 2 ... 'Z' -> 26 Given an encoded message containing digits, determine the total nu
2017-07-12 15:38:23 205
原创 474. Ones and Zeroes
In the computer world, use restricted resource you have to generate maximum benefit is what we always want to pursue. For now, suppose you are a dominator of m 0s and n 1s respectively. On the othe
2017-07-12 09:20:11 319
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人