class Solution { public static void main(String[] args) { int[] arr = new int[]{0, 1, 2, 2, 2, 3, 4, 5}; //int index = binarySearch(arr, 2); //int ind ...
分类:
其他好文 时间:
2021-03-31 11:46:55
阅读次数:
0
48. 旋转图像 LeetCode_48 题目描述 方法一:使用辅助数组 class Solution { public void rotate(int[][] matrix) { //第i,j的元素翻转后出现在倒数第i列的第j个元素 int m = matrix.length; int n = m ...
分类:
编程语言 时间:
2021-03-30 13:19:14
阅读次数:
0
\(\text{Problem}:\)Three strings \(\text{Solution}:\) 仿照 \(\text{SA}\) 连接多个串的方式,我们可以把这三个串连成:\(A+\)#\(+B+\)?\(+C\) 的形式。那么 \(A,B,C\) 中相同的子串在 \(\text{SAM ...
分类:
其他好文 时间:
2021-03-30 13:18:03
阅读次数:
0
啊啊啊~ 目的 1、考虑图像预处理的合理性和结果。能达到什么样的结果,该结果是否满足我的需要,如果多余是否有删除的必要? 2、切割问题,他是怎样实现字符的切割的?字符之间识别的依据和划定该依据的标准是什么? Part 1 % function [d]=main() close all clc % 清 ...
分类:
其他好文 时间:
2021-03-30 13:15:22
阅读次数:
0
/* struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { } };*/class Solution { public: ListNode* FindFirstCommonNo ...
分类:
其他好文 时间:
2021-03-29 12:50:50
阅读次数:
0
思路:利用逻辑符的短路性质设置递归边界。 剑指 Offer 64. 求1+2+…+n class Solution { int res = 0; public int sumNums(int n) { boolean x = n > 1 && sumNums(n-1) > 0; res += n; ...
分类:
其他好文 时间:
2021-03-29 12:40:44
阅读次数:
0
1.题目描述 给你 n 个非负整数 a1,a2,...,an,每个数代表坐标中的一个点 (i, ai) 。在坐标内画 n 条垂直线,垂直线 i 的两个端点分别为 (i, ai) 和 (i, 0) 。找出其中的两条线,使得它们与 x 轴共同构成的容器可以容纳最多的水。 说明:你不能倾斜容器 示例 1: ...
分类:
其他好文 时间:
2021-03-29 12:37:26
阅读次数:
0
新的一天开始刷题。 这道题完全没有思路,忘记了异或操作。 思路注释里写的很清晰了,注意&与&&的差别以及最后返回的写法。 剑指 Offer 56 - I. 数组中数字出现的次数 class Solution { public int[] singleNumbers(int[] nums) { int ...
分类:
编程语言 时间:
2021-03-26 15:24:12
阅读次数:
0
这个题蛮有意思的。学习了大佬的思路。 注意边界情况,当输入空数组时,返回了一个匿名数组的写法。 以及保证数组不越界,及时退出循环的思路。 我原来写的while循环条件是(cnt<num),且没有写退出循环的四个判断,是有问题的。 class Solution { public int[] spira ...
分类:
其他好文 时间:
2021-03-18 14:39:28
阅读次数:
0
Given a non-negative integer, you could swap two digits at most once to get the maximum valued number. Return the maximum valued number you could get. ...
分类:
其他好文 时间:
2021-03-18 14:32:17
阅读次数:
0