
算法
LinXuanran
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
还原排列的最少操作步数
还原排列的最少操作步数 1 class Solution { public int reinitializePermutation(int n) { int i = 1, res = 0; while(true){ res++; if(i < n / 2) i = 2 * i; else i = (i - n / 2) * 2 + 1; if(i == 1) .原创 2021-03-30 13:42:13 · 174 阅读 · 0 评论 -
leetcode116 119
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is symmetric: 1 / 2 2 / \ / 3 4 4 3 class Solution...原创 2019-10-22 09:31:47 · 229 阅读 · 0 评论 -
动态规划题目思路整体
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given the following triangle [ [2], [3,4], [6,5,7], [4,1,8,3] ...原创 2019-08-17 08:54:13 · 234 阅读 · 0 评论 -
每天leetcode 记录
给定范围 [m, n],其中 0 <= m <= n <= 2147483647,返回此范围内所有数字的按位与(包含 m, n 两端点)。 示例 1: 输入: [5,7] 输出: 4 示例 2: 输入: [0,1] 输出: 0 贡献者 class Solution { public int rangeBitwiseAnd(int m, int n) { i...原创 2019-10-02 19:16:43 · 156 阅读 · 0 评论