编译和运行Clojure分支20081217源码
发表于
更新于
[leetcode 329]Longest Increasing Path in a Matrix 原创解法
发表于
更新于
题目概述
Given an integer matrix, find the length of the longest increasing path
From each cell, you can either move to four directions: left, right, up or down. You may NOT move diagonally or move outside of the boundary (i.e. wrap-around is not allowed).
example:
nums = [
[9,9,4],
[6,6,8],
[2,1,1]
]
return 4
How to call java code in Grails 3.2.6
发表于
更新于
[leetcode 295]Find Median from Data Stream 原创解法
发表于
更新于
题目概述
Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two middle value.
Examples:
`[2,3,4]` , the median is 3
`[2,3]`, the median is (2 + 3) / 2 = 2.5
Design a data structure that supports the following two operations:
- void addNum(int num) - Add a integer number from the data stream to the data structure.
- double findMedian() - Return the median of all elements so far.
For example:
addNum(1)
addNum(2)
findMedian() -> 1.5
addNum(3)
findMedian() -> 2
解决python3使用system-site-packages创建虚拟环境时没有pip的问题
发表于
更新于
在WIN10下使用Cython
发表于
更新于
[leetcode 327]Count of Range Sum 原创解法
发表于
更新于
题目概述
Given an integer array nums, return the number of range sums that lie in [lower, upper] inclusive.
Range sum S(i, j) is defined as the sum of the elements in nums between indices i and j (i ≤ j), inclusive.
Example:
Given nums = [-2, 5, -1], lower = -2, upper = 2,
Return 3.
The three ranges are : [0, 0], [2, 2], [0, 2] and their respective sums are: -2, -1, 2.
[leetcode 315]Count of Smaller Numbers After Self 原创解法
发表于
更新于
题目概述
You are given an integer array nums and you
have to return a new counts array.
The counts array has the property where counts[i] is
the number of smaller elements to the right of nums[i].
Example:
Given nums = [5, 2, 6, 1]
To the right of 5 there are 2 smaller elements (2 and 1).
To the right of 2 there is only 1 smaller element (1).
To the right of 6 there is 1 smaller element (1).
To the right of 1 there is 0 smaller element.
Return the array [2, 1, 1, 0].