- 博客(10)
- 资源 (6)
- 收藏
- 关注
原创 leetcode 53. Maximum Subarray 解法 python
一.问题描述Given an integer arraynums, find the contiguous subarray(containing at least one number) which has the largest sum and return its sum.Example:Input: [-2,1,-3,4,-1,2,1,-5,4],Output: 6E...
2019-05-19 23:16:47 818
原创 leetcode 9. Palindrome Number 解法 python
一.问题描述Determine whether an integer is a palindrome. An integerisapalindrome when itreads the same backward as forward.Example 1:Input: 121Output: trueExample 2:Input: -121Output: fa...
2019-05-07 23:52:53 594
原创 leetcode 1037. Valid Boomerang 解法 python
一.问题描述Aboomerangis a set of 3 points that are all distinct andnotin a straight line.Given a listof three points in the plane, return whether these points are a boomerang.Example 1:Inp...
2019-05-06 10:49:44 416
原创 leetcode 1038. Binary Search Tree to Greater Sum Tree 解法 python
一.问题描述Given the root of a binarysearchtree with distinct values, modify it so that everynodehas a new value equal to the sum of the values of the original tree that are greater than or equal to...
2019-05-05 18:59:32 1086
原创 leetcode 4. Median of Two Sorted Arrays 解法 python
一.问题描述There are two sorted arraysnums1andnums2of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).You may assumenum...
2019-05-04 17:10:28 1349
原创 leetcode 3. Longest Substring Without Repeating Characters(无重复最长子串) 解法 python
这道题去年用java写过一次,回头看感觉不堪入目,哈哈,这次用python再做一遍一.问题描述Given a string, find the length of thelongest substringwithout repeating characters.Example 1:Input: "abcabcbb"Output: 3 Explanation: The an...
2019-05-02 23:26:18 333
原创 leetcode 2. Add Two Numbers(两数相加) 解法 python
一.问题描述You are given twonon-emptylinked lists representing two non-negative integers. The digits are stored inreverse orderand each of their nodes contain a single digit. Add the two numbers and ...
2019-05-02 21:53:58 413
原创 机器学习SVM中关于函数间隔为什么可以设置为1
我是没看懂上图的解释的,然后上网查了一下大家的看法首先我觉得关于那些说除 函数间隔 的不是那么科学因为函数间隔是个变量又不是个常数,这是说除就除的嘛首先明确一点,对于几何间隔都说,不管w和b变成几倍增加,几何间隔都不会变,这就会导致一个问题,满足图中式7.11和7.12的最优解有多个,是一个集合。因为如果w1,b1是一个最优解,那么kw1,kb1也是最优解然而我们只需要一个就行...
2019-05-02 13:34:39 2349 7
原创 leetcode 673. Number of Longest Increasing Subsequence(最长递增子序列的个数)解法 python
一.问题描述Given an unsorted array of integers, find the number of longest increasing subsequence.Example 1:Input: [1,3,5,4,7]Output: 2Explanation: The two longest increasing subsequence are [1, 3...
2019-05-01 20:35:10 388
原创 leetcode 38. Count and Say(报数) 解法 python
一.问题描述The count-and-say sequence is the sequence of integers with the first five terms as following:1. 12. 113. 214. 12115. 1112211is read off as"one 1"or11.11is r...
2019-05-01 00:27:40 297
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人