上一页 1 ··· 171 172 173 174 175 176 177 178 179 ··· 274 下一页
摘要: You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 ston 阅读全文
posted @ 2018-03-11 21:54 bonelee 阅读(175) 评论(0) 推荐(0)
摘要: Given a positive integer, check whether it has alternating bits: namely, if two adjacent bits will always have different values. Example 1: Input: 5 O 阅读全文
posted @ 2018-03-11 21:14 bonelee 阅读(262) 评论(0) 推荐(0)
摘要: Given a group of two strings, you need to find the longest uncommon subsequence of this group of two strings. The longest uncommon subsequence is defi 阅读全文
posted @ 2018-03-11 20:32 bonelee 阅读(201) 评论(0) 推荐(0)
摘要: 高级语法 除了像上面介绍的 [x ** 2 for x in L] 这种基本语法之外,列表推导式还有一些高级的扩展。 4.1. 带有if语句 我们可以在 for 语句后面跟上一个 if 判断语句,用于过滤掉那些不满足条件的结果项。 例如,我想去除列表中所有的偶数项,保留奇数项,可以这么写: >>> 阅读全文
posted @ 2018-03-11 18:33 bonelee 阅读(36014) 评论(5) 推荐(13)
摘要: Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array. Example 1: Note: 解法1: 精简版: 解法2: DFS 使用一个数组 阅读全文
posted @ 2018-03-11 17:49 bonelee 阅读(431) 评论(0) 推荐(0)
摘要: You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1' 阅读全文
posted @ 2018-03-10 22:01 bonelee 阅读(284) 评论(0) 推荐(0)
摘要: You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/ve 阅读全文
posted @ 2018-03-10 08:39 bonelee 阅读(371) 评论(0) 推荐(0)
摘要: You're now a baseball game point recorder. Given a list of strings, each string can be one of the 4 following types: Each round's operation is permane 阅读全文
posted @ 2018-03-09 23:14 bonelee 阅读(221) 评论(0) 推荐(0)
摘要: In MATLAB, there is a very useful function called 'reshape', which can reshape a matrix into a new one with different size but keep its original data. 阅读全文
posted @ 2018-03-09 21:43 bonelee 阅读(190) 评论(0) 推荐(0)
摘要: Python:SMOTE算法 直接用python的库, imbalanced-learn imbalanced-learn is a python package offering a number of re-sampling techniques commonly used in dataset 阅读全文
posted @ 2018-03-09 17:26 bonelee 阅读(38341) 评论(0) 推荐(1)
上一页 1 ··· 171 172 173 174 175 176 177 178 179 ··· 274 下一页