随笔分类 - 算法
摘要:2021-06-23 LeetCode每日一题 链接:https://leetcode-cn.com/problems/er-jin-zhi-zhong-1de-ge-shu-lcof/ 标签:位运算 题目 请实现一个函数,输入一个整数(以二进制串形式),输出该数二进制表示中 1 的个数。例如,把
阅读全文
摘要:2021-06-22 LeetCode每日一题 链接:https://leetcode-cn.com/problems/zi-fu-chuan-de-pai-lie-lcof/ 标签:回溯 题目 输入一个字符串,打印出该字符串中字符的所有排列。 你可以以任意顺序返回这个字符串数组,但里面不能有重复元
阅读全文
摘要:2021-06-21 LeetCode每日一题 链接:https://leetcode-cn.com/problems/binary-watch/ 标签:位运算、回溯 题目 二进制手表顶部有 4 个 LED 代表 小时(0-11),底部的 6 个 LED 代表 分钟(0-59)。每个 LED 代表一
阅读全文
摘要:2021-06-20 LeetCode每日一题 链接:https://leetcode-cn.com/problems/throne-inheritance/ 标签:树、先序遍历 题目 一个王国里住着国王、他的孩子们、他的孙子们等等。每一个时间点,这个家庭里有人出生也有人死亡。 这个王国有一个明确规
阅读全文
摘要:链接:https://leetcode-cn.com/problems/qing-wa-tiao-tai-jie-wen-ti-lcof/ 标签:递归、动态规划 题目 一只青蛙一次可以跳上1级台阶,也可以跳上2级台阶。求该青蛙跳上一个 n 级的台阶总共有多少种跳法。 答案需要取模 1e9+7(100
阅读全文
摘要:2021-06-18 LeetCode每日一题 链接:https://leetcode-cn.com/problems/smallest-good-base/ 标签:数学、二分查找 题目 对于给定的整数 n, 如果n的k(k>=2)进制数的所有数位全为1,则称 k(k>=2)是 n 的一个好进制。
阅读全文
摘要:2021-06-15 LeetCode每日一题 链接:https://leetcode-cn.com/problems/peak-index-in-a-mountain-array/ 标签:二分 题目 符合下列属性的数组 arr 称为 山脉数组 : arr.length >= 3 存在 i(0 <
阅读全文
摘要:链接:https://leetcode-cn.com/problems/coin-change/ 标签:动态规划、完全背包问题、广度优先搜索 题目 给定不同面额的硬币 coins 和一个总金额 amount。编写一个函数来计算可以凑成总金额所需的最少的硬币个数。如果没有任何一种硬币组合能组成总金额,
阅读全文
摘要:给你5亿个数据,帮我排下序?
阅读全文

浙公网安备 33010602011771号