- 博客(9)
- 资源 (1)
- 收藏
- 关注
原创 Maximum Depth of N-ary Tree
Given a n-ary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.For example, given a 3-ary tree: ...
2018-09-19 16:48:36 185
原创 LeetCode Hand of Straights
Alice has a hand of cards, given as an array of integers.Now she wants to rearrange the cards into groups so that each group is size W, and consists of W consecutive cards.Return true if and only ...
2018-09-12 10:26:51 233
原创 LeetCode Add Strings
Given two non-negative integers num1 and num2 represented as string, return the sum of num1 and num2.Note:The length of both num1 and num2 is < 5100. Both num1 and num2 contains only digits 0-...
2018-09-04 15:50:33 195
原创 数组最大连续子序列和
题目:给定一个数组,其中元素可正可负,求其中最大连续子序列的和。这题是一道非常经典的面试题,会经常出现在各种面试中,具体有好几种不同时间复杂度的解法,那么最好的方法是用动态规划方法来求解。第一种:时间复杂度为O(n^3)暴力法求解。三层循环,从起点和终点开始,第一层循环确定起点,第二层循环确定终点,第三层循环在起点和终点之间遍历。public static int maxSubA...
2018-09-04 14:11:12 5457 1
转载 机器学习“特征编码”解析
1 为什么要进行特征编码?我们拿到的数据通常比较脏乱,可能会带有各种非数字特殊符号,比如中文。下面这个表中显示了我们最原始的数据集。而实际上机器学习模型需要的数据是数字型的,因为只有数字类型才能进行计算。因此,对于各种特殊的特征值,我们都需要对其进行相应的编码,也是量化的过程。2 特征编码类型本篇,我们主要说一下分类型特征的编码方式。对于分类型数据的编码,我们通常会使用两种方式来实...
2018-09-04 06:57:34 13995 2
原创 LeetCode Min Cost Climbing Stairs
On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed).Once you pay the cost, you can either climb one or two steps. You need to find minimum cost to reach the top of ...
2018-09-03 17:13:12 119
原创 LeetCode Positions of Large Groups
In a string S of lowercase letters, these letters form consecutive groups of the same character.For example, a string like S = "abbxxxxzyy" has the groups "a", "bb", "xxxx", "z" and "yy".Call
2018-09-03 13:14:07 187
原创 LeetCode 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:The...
2018-09-02 20:46:51 158
原创 LeetCode Contains Duplicate III
Given an array of integers, find out whether there are two distinct indices i and j in the array such that the absolute difference between nums[i] and nums[j] is at most t and the absolute difference ...
2018-09-02 19:54:37 172
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人