上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 29 下一页
摘要: Given a non negative integer number **num**. For every numbers **i** in the range **0 ≤ i ≤ num** calculate the number of 1's in their binary representation and return them as an array. 阅读全文
posted @ 2019-06-26 11:43 yjxyy 阅读(162) 评论(0) 推荐(0) 编辑
摘要: You are given coins of different denominations and a total amount of money *amount*. Write a function to compute the fewest number of coins that you need to make up that amount. If that amount of money cannot be made up by any combination of the coins, return `-1`. 阅读全文
posted @ 2019-06-26 11:29 yjxyy 阅读(230) 评论(0) 推荐(0) 编辑
摘要: Given an array `nums` of *n* integers where *n* > 1, return an array `output` such that `output[i]` is equal to the product of all the elements of `nums` except `nums[i]`. 阅读全文
posted @ 2019-06-26 11:25 yjxyy 阅读(98) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. 阅读全文
posted @ 2019-06-26 11:20 yjxyy 阅读(171) 评论(0) 推荐(0) 编辑
摘要: Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. 阅读全文
posted @ 2019-06-25 23:46 yjxyy 阅读(157) 评论(0) 推荐(0) 编辑
摘要: Find the **k**th largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. 阅读全文
posted @ 2019-06-25 23:41 yjxyy 阅读(137) 评论(0) 推荐(0) 编辑
摘要: There are a total of *n* courses you have to take, labeled from `0` to `n-1`. Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a pair: `[0,1]` Given the total number of courses and a list of prerequisite **pairs**, is it possible for you to finish all courses? 阅读全文
posted @ 2019-06-25 23:37 yjxyy 阅读(474) 评论(0) 推荐(0) 编辑
摘要: Given a 2d grid map of `'1'`s (land) and `'0'`s (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water. 阅读全文
posted @ 2019-06-25 16:49 yjxyy 阅读(162) 评论(0) 推荐(0) 编辑
摘要: Given an integer array `nums`, find the contiguous subarray within an array (containing at least one number) which has the largest product. 阅读全文
posted @ 2019-06-25 16:43 yjxyy 阅读(126) 评论(0) 推荐(0) 编辑
摘要: Sort a linked list in *O*(*n* log *n*) time using constant space complexity. 阅读全文
posted @ 2019-06-24 23:45 yjxyy 阅读(1028) 评论(0) 推荐(0) 编辑
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 29 下一页