没啥太难的思路,代码如下: /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * List ...
分类:
编程语言 时间:
2021-02-18 12:53:10
阅读次数:
0
1. 题目 表1: Person ± ± +| 列名 | 类型 |± ± +| PersonId | int || FirstName | varchar || LastName | varchar |± ± +PersonId 是上表主键表2: Address ± ± +| 列名 | 类型 |± ...
分类:
数据库 时间:
2021-02-17 15:09:12
阅读次数:
0
此博客链接:https://www.cnblogs.com/ping2yingshi/p/14402948.html 石子游戏 题目链接:https://leetcode-cn.com/problems/stone-game/ 题目 亚历克斯和李用几堆石子在做游戏。偶数堆石子排成一行,每堆都有正整数 ...
分类:
其他好文 时间:
2021-02-17 14:57:21
阅读次数:
0
给定一个整数数组 a,其中1 ≤ a[i] ≤ n (n为数组长度), 其中有些元素出现两次而其他元素出现一次。 找到所有出现两次的元素。 你可以不用到任何额外空间并在O(n)时间复杂度内解决这个问题吗? 示例: 输入: [4,3,2,7,8,2,3,1] 输出: [2,3] 来源:力扣(LeetC ...
分类:
编程语言 时间:
2021-02-17 14:53:13
阅读次数:
0
来源: https://leetcode-cn.com/problems/lowest-common-ancestor-of-a-binary-tree/solution/er-cha-shu-de-zui-jin-gong-gong-zu-xian-by-leetc-2/ 信息分类: IT/算法 ...
分类:
其他好文 时间:
2021-02-17 14:40:10
阅读次数:
0
给定一个非空且只包含非负数的整数数组 nums, 数组的度的定义是指数组里任一元素出现频数的最大值。 你的任务是找到与 nums 拥有相同大小的度的最短连续子数组,返回其长度。 示例 1: 输入: [1, 2, 2, 3, 1] 输出: 2 解释: 输入数组的度是2,因为元素1和2的出现频数最大,均 ...
分类:
编程语言 时间:
2021-02-17 14:37:36
阅读次数:
0
比赛地址:这里 T1: 根据题意,符合题目要求的只有两种字符串:0101010…或1010101…,因此,我们可以直接构造这两种字符串并比较与原串的差异即可。 附上代码: class Solution { public: int minOperations(string s) { int len = ...
分类:
其他好文 时间:
2021-02-17 14:32:43
阅读次数:
0
We are given a matrix with rows and columns has cells with integer coordinates , where?`0 这道题给了一个R行C列的矩阵,又给了一个起始点 (r0, c0),让按照离起始点的曼哈顿距离从小到大排序坐标点。博主最先 ...
分类:
其他好文 时间:
2021-02-17 14:32:03
阅读次数:
0
BFS/DFS 在树专题和回溯算法中其实已经涉及到了BFS和DFS算法,这里单独提出再进一步学习一下 BFS 广度优先遍历 Breadth-First-Search 这部分的内容也主要是学习了labuladong公众号内的相关讲解 算法流程 首先将开始节点放入队列中。 从队列中取出第一个节点,并检验 ...
分类:
其他好文 时间:
2021-02-17 14:23:20
阅读次数:
0
A company is planning to interview people. Given the array where ,?the cost of flying the person to city is , and the cost of flying the person to cit ...
分类:
其他好文 时间:
2021-02-17 14:20:21
阅读次数:
0