LeetCode
xiuscut
闲置在家
展开
-
LeetCode 杨辉三角 题目解答
/** * Return an array of arrays. * The sizes of the arrays are returned as *columnSizes array. * Note: Both returned array and *columnSizes array must be malloced, assume caller calls free(). */i...原创 2018-11-08 13:58:10 · 451 阅读 · 0 评论 -
LeetCode 给定一个非负整数 num。对于 0 ≤ i ≤ num 范围中的每个数字 i ,计算其二进制数中的 1 的数目并将它们作为数组返回。
/** * Return an array of size *returnSize. * Note: The returned array must be malloced, assume caller calls free(). */int* countBits(int num, int* returnSize) { printf("num:%d \n",num); in...原创 2018-11-08 14:23:17 · 2045 阅读 · 0 评论 -
LeetCode 给定一个 N 叉树,找到其最大深度。 最大深度是指从根节点到最远叶子节点的最长路径上的节点总数
/*// Definition for a Node.class Node {public: int val; vector<Node*> children; Node() {} Node(int _val, vector<Node*> _children) { val = _val; childre...原创 2018-11-08 15:28:49 · 1312 阅读 · 0 评论