自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

负雪明烛

算法题博主,7 年写了 1000 多篇 LeetCode 题解,致力于帮助更多人拿到满意的 Offer!

  • 博客(33)
  • 收藏
  • 关注

原创 【LeetCode】338. Counting Bits 解题报告(Python & Java & C++)

【LeetCode】Counting Bits 解题报告标签(空格分隔): LeetCode题目地址:https://leetcode.com/problems/counting-bits/#/description题目描述:Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num ca

2017-04-26 16:04:31 1879

原创 【LeetCode】35. Search Insert Position 解题报告(Java & Python)

【LeetCode】Search Insert Position 解题报告标签(空格分隔): LeetCode题目地址:https://leetcode.com/problems/search-insert-position/#/description题目描述:Given a sorted array and a target value, return the index if the targe

2017-04-25 12:54:56 1885

原创 【LeetCode】108. Convert Sorted Array to Binary Search Tree 解题报告 (Java & Python)

【LeetCode】Convert Sorted Array to Binary Search Tree 解题报告标签(空格分隔): LeetCode题目地址:https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/#/description题目描述:Given an array where elements

2017-04-24 21:23:41 2801

原创 【LeetCode】543. Diameter of Binary Tree 解题报告 (C++&Java&Python)

【LeetCode】Diameter of Binary Tree 解题报告标签(空格分隔): LeetCode题目地址:https://leetcode.com/problems/diameter-of-binary-tree/#/description题目描述:Given a binary tree, you need to compute the length of the diameter

2017-04-21 20:11:52 2114

原创 【LeetCode】551. Student Attendance Record I 解题报告(Java & Python)

【LeetCode】Student Attendance Record I 解题报告标签(空格分隔): LeetCode题目地址:https://leetcode.com/problems/student-attendance-record-i/#/description题目描述:You are given a string representing an attendance record for

2017-04-21 19:45:49 1255

原创 【LeetCode】268. Missing Number 解题报告(Java & Python)

【LeetCode】Missing Number 解题报告标签(空格分隔): LeetCode题目地址:https://leetcode.com/problems/missing-number/#/description题目描述:Given an array containing n distinct numbers taken from 0, 1, 2, …, n, find the one th

2017-04-21 17:22:04 4965

原创 【剑指Offer】07. 重建二叉树 解题报告(Java & Python & C++)

【剑指Offer】重建二叉树 解题报告(Java & Python)标签(空格分隔): 剑指Offer题目地址:https://www.nowcoder.com/ta/coding-interviews题目描述:输入某二叉树的前序遍历和中序遍历的结果,请重建出该二叉树。假设输入的前序遍历和中序遍历的结果中都不含重复的数字。例如输入前序遍历序列{1,2,4,7,3,5,6...

2017-04-20 20:14:26 657

原创 【剑指Offer】06. 从尾到头打印链表 解题报告(Java & python)

【剑指Offer】从尾到头打印链表 解题报告标签(空格分隔): LeetCode题目地址:https://www.nowcoder.com/ta/coding-interviews题目描述:输入一个链表,从尾到头打印链表每个节点的值。Ways先存到ArrayList里再反转,不算作弊吧。/*** public class ListNode {* ...

2017-04-20 18:37:03 869 1

原创 【剑指Offer】05. 替换空格 解题报告 (Python & C++ & Java)

【剑指Offer】替换空格 解题报告标签(空格分隔): LeetCode题目地址:https://www.nowcoder.com/ta/coding-interviews题目描述:请实现一个函数,将一个字符串中的空格替换成“%20”。例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy。Ways题目不能直接使用repalceAll()方法。所以用了下面

2017-04-20 18:06:42 615

原创 【剑指Offer】04. 二维数组中的查找 解题报告(Java & Python & C++)

【剑指Offer】二维数组中的查找 解题报告(Java & Python)标签(空格分隔): LeetCode题目地址:https://www.nowcoder.com/ta/coding-interviews题目描述:在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是...

2017-04-20 15:26:20 825

原创 【LeetCode】122.Best Time to Buy and Sell Stock II 解题报告(Java & Python & C++)

【LeetCode】122.Best Time to Buy and Sell Stock II 解题报告(Java & Python)标签(空格分隔): LeetCode题目地址:https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/#/description题目描述:Say you have...

2017-04-20 14:51:22 2531

原创 【LeetCode】547. Friend Circles 解题报告(Python & Java & C++)

【LeetCode】Friend Circles 解题报告标签(空格分隔): LeetCode题目地址:https://leetcode.com/problems/friend-circles/#/description题目描述:There are N students in a class. Some of them are friends, while some are not. Their f

2017-04-20 14:26:56 2977

原创 【LeetCode】114. Flatten Binary Tree to Linked List 解题报告(Python & C++ & Java)

【LeetCode】Flatten Binary Tree to Linked List 解题报告标签(空格分隔): LeetCode题目地址:https://leetcode.com/problems/flatten-binary-tree-to-linked-list/#/description题目描述:Given a binary tree, flatten it to a linked li

2017-04-19 15:34:30 3432 7

原创 【LeetCode】167. Two Sum II - Input array is sorted 解题报告(Python)

【LeetCode】Two Sum II - Input array is sorted 解题报告标签(空格分隔): LeetCode题目地址:https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/#/description题目描述:Given an array of integers that is already sorte

2017-04-18 20:48:08 2220

原创 【LeetCode】98. Validate Binary Search Tree 解题报告(Python & C++ & Java)

【LeetCode】Validate Binary Search Tree 解题报告(Java & Python)标签(空格分隔): LeetCode题目地址:https://leetcode.com/problems/validate-binary-search-tree/#/description题目描述:Given a binary tree, determine...

2017-04-17 13:06:44 4224

原创 【LeetCode】504. Base 7 解题报告(Java & Python)

【LeetCode】Base 7 解题报告标签(空格分隔): LeetCode题目地址:https://leetcode.com/problems/base-7/#/description题目描述:Given an integer, return its base 7 string representation.Example:Input: 100Output: "202"Input: -7Ou

2017-04-16 12:12:12 1503

原创 【LeetCode】515. Find Largest Value in Each Tree Row 解题报告(Python & C++ & Java)

【LeetCode】Find Largest Value in Each Tree Row 解题报告标签(空格分隔): LeetCode题目地址:https://leetcode.com/problems/find-largest-value-in-each-tree-row/#/description题目描述:You need to find the largest value in each r

2017-04-15 11:18:00 1247 2

原创 【LeetCode】506. Relative Ranks 相对名次

LeetCode,506,相对名次,排序数组给你一个长度为 n 的整数数组 score ,其中 score[i] 是第 i 位运动员在比赛中的得分。所有得分都 互不相同 。运动员将根据得分 决定名次 ,其中名次第 1 的运动员得分最高,名次第 2 的运动员得分第 2 高,依此类推。运动员的名次决定了他们的获奖情况:名次第 1 的运动员获金牌 "Gold Medal" 。名次第 2 的运动员获银牌 "Silver Medal" 。名次第 3 的运动员获铜牌 "Bronze Medal" 。

2017-04-14 16:21:57 1562

原创 【LeetCode】513. Find Bottom Left Tree Value 解题报告(Python & C++ & Java)

【LeetCode】Find Bottom Left Tree Value 解题报告标签(空格分隔): LeetCode题目地址:https://leetcode.com/problems/find-bottom-left-tree-value/#/description题目描述:Given a binary tree, find the leftmost value in the last row

2017-04-13 20:34:48 1480 5

原创 【LeetCode】541. Reverse String II 解题报告(Python)

【LeetCode】Reverse String II 解题报告标签(空格分隔): LeetCode题目地址:https://leetcode.com/problems/reverse-string-ii/#/description题目描述:Given a string and an integer k, you need to reverse the first k characters for

2017-04-12 13:38:25 1736

原创 【LeetCode】557. Reverse Words in a String III 解题报告(Java & Python)

【LeetCode】Reverse Words in a String III 解题报告标签(空格分隔): LeetCode题目地址:https://leetcode.com/problems/reverse-words-in-a-string-iii/#/description题目描述:Given a string, you need to reverse the order of charact

2017-04-12 11:48:48 2613

原创 【LeetCode】01 Matrix 解题报告

【LeetCode】01 Matrix 解题报告标签(空格分隔): LeetCode题目地址:https://leetcode.com/problems/01-matrix/#/description题目描述:Given a matrix consists of 0 and 1, find the distance of the nearest 0 for each cell.The distanc

2017-04-11 14:18:38 3772

原创 【LeetCode】230. 二叉搜索树中第K小的元素 Kth Smallest Element in a BST

【LeetCode】Kth Smallest Element in a BST 解题报告标签(空格分隔): LeetCode题目地址:https://leetcode.com/problems/kth-smallest-element-in-a-bst/#/description题目描述:Given a binary search tree, write a function kthSmallest

2017-04-10 14:28:57 1575

原创 【LeetCode】49. Group Anagrams 解题报告(Python & Java & C++)

【LeetCode】Group Anagrams 解题报告(Python & Java)标签(空格分隔): LeetCode题目地址:https://leetcode.com/problems/anagrams/#/description题目描述:Given an array of strings, group anagrams together.Example...

2017-04-09 16:18:43 2585

原创 【LeetCode】530. Minimum Absolute Difference in BST 解题报告(Java & Python)

【LeetCode】Minimum Absolute Difference in BST 解题报告标签(空格分隔): LeetCode题目地址:https://leetcode.com/problems/minimum-absolute-difference-in-bst/#/description题目描述:Given a binary search tree with non-negative v

2017-04-08 13:01:00 1555

原创 【LeetCode】Longest Word in Dictionary through Deleting 解题报告

【LeetCode】Longest Word in Dictionary through Deleting 解题报告标签(空格分隔): LeetCode题目地址:https://leetcode.com/problems/longest-word-in-dictionary-through-deleting/#/description题目描述:Given a string and a string

2017-04-07 14:51:47 2281

原创 【机器学习】决策树(Decision Tree) 学习笔记

【机器学习】决策树(decision tree) 学习笔记标签(空格分隔): 机器学习决策树简介决策树(decision tree)是一个树结构(可以是二叉树或非二叉树)。其每个非叶节点表示一个特征属性上的测试,每个分支代表这个特征属性在某个值域上的输出,而每个叶节点存放一个类别。使用决策树进行决策的过程就是从根节点开始,测试待分类项中相应的特征属性,并按照其值选择输出分支,直到到达叶子节点,将叶子

2017-04-06 19:52:10 1671

原创 【LeetCode】Largest Number 解题报告

【LeetCode】Largest Number 解题报告标签(空格分隔): LeetCode题目地址:https://leetcode.com/problems/largest-number/#/description题目描述:Given a list of non negative integers, arrange them such that they form the largest nu

2017-04-05 14:23:49 1137

原创 【LeetCode】56. Merge Intervals 解题报告(Python & C++ & Java)

【LeetCode】Merge Intervals 解题报告标签(空格分隔): LeetCode题目地址:https://leetcode.com/problems/merge-intervals/#/description题目描述:Given a collection of intervals, merge all overlapping intervals.Example :For exampl

2017-04-04 16:33:13 2530

原创 【机器学习】k-近邻算法(kNN) 学习笔记

【机器学习】k-近邻算法(kNN) 学习笔记标签(空格分隔): 机器学习kNN简介kNN算法是做分类问题的。思想如下:KNN算法的思想总结一下:就是在训练集中数据和标签已知的情况下,输入测试数据,将测试数据的特征与训练集中对应的特征进行相互比较,找到训练集中与之最为相似的前K个数据,则该测试数据对应的类别就是K个数据中出现次数最多的那个分类,其算法的描述为:计算测试数据与各个训练数据之间的距离;

2017-04-03 19:31:46 4095

原创 【LeetCode】492. Construct the Rectangle 解题报告(Java & Python)

【LeetCode】Construct the Rectangle 解题报告标签(空格分隔): LeetCode题目地址:https://leetcode.com/problems/construct-the-rectangle/#/description题目描述:For a web developer, it is very important to know how to design a we

2017-04-03 11:45:23 1083

原创 【LeetCode】520. Detect Capital 解题报告(Java & Python)

【LeetCode】Detect Capital 解题报告标签(空格分隔): LeetCode题目地址:https://leetcode.com/problems/detect-capital/#/description题目描述:Given a word, you need to judge whether the usage of capitals in it is right or not.We

2017-04-03 10:59:03 1372

原创 【LeetCode】500. Keyboard Row 解题报告(Java & Python)

【LeetCode】Keyboard Row 解题报告标签(空格分隔): LeetCode题目地址:https://leetcode.com/problems/keyboard-row/#/description题目描述:Given a List of words, return the words that can be typed using letters of alphabet on onl

2017-04-02 19:16:13 1149

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除