problem 1394. Find Lucky Integer in an Array solution #1: 使用哈希表; 使用哈希表记录数组元素和freq,然后判断是否相等,且取最大值; 注意 1. 最大值可以由下标一次递减隐性表示; 2. 数值的范围是1-500; 参考 1. leetco ...
分类:
其他好文 时间:
2020-07-16 00:22:19
阅读次数:
51
problem 1380. Lucky Numbers in a Matrix 在矩阵中,如果一个数既是它所在行的最小值,又是它所在列的最大值,则称这个数为幸运数。找到矩阵中所有的幸运数。 Constraints All elements in the matrix are distinct. so ...
分类:
其他好文 时间:
2020-07-16 00:15:33
阅读次数:
72
Description A balanced number is a non-negative integer that can be balanced if a pivot is placed at some digit. More specifically, imagine each digit ...
分类:
其他好文 时间:
2020-07-16 00:05:52
阅读次数:
79
地址:https://leetcode-cn.com/problems/consecutive-numbers/ ## 编写一个 SQL 查询,查找所有至少连续出现三次的数字。 示例: 编写一个 SQL 查询,查找所有至少连续出现三次的数字。 + + + | Id | Num | + + + | 1 ...
分类:
其他好文 时间:
2020-07-16 00:03:52
阅读次数:
59
题意:给定一个长度为n的序列,可以修改任何一个字符,求修改后最长的单调严格上升子序列(必须是连续的)。 分析:\((1 <= n < 10^5)\),数据范围很大,不能使用$o(n^2)$的算法。所以我们可以从线性角度考虑,一种常见的套路是枚举修改点,然后求最大值。我们只需要分别求出两端的情况即可, ...
分类:
其他好文 时间:
2020-07-15 23:25:08
阅读次数:
90
Angle Between Hands of a Clock (M) 题目 Given two numbers, hour and minutes. Return the smaller angle (in degrees) formed between the hour and the minut ...
分类:
其他好文 时间:
2020-07-15 10:47:17
阅读次数:
102
260 Single Number III Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. ...
分类:
其他好文 时间:
2020-07-14 21:54:31
阅读次数:
104
[BJDCTF2020]Mark loves cat 发现git泄露,使用gitHack工具进行分析 python GitHack.py http://00db6bf7-dacb-4734-965d-9974f3882333.node3.buuoj.cn/.git 获得index.php和flag. ...
分类:
其他好文 时间:
2020-07-12 20:38:41
阅读次数:
103
【题解】Street Numbers [UVA138] 传送门:\(\text{Street Numbers [UVA138]}\) 【题目描述】 求满足 \(n<m\) 且 \(\sum_{i=1}^{n-1}i=\sum_{i=n+1}^{m}i\) 的正整数对 \(n,m\) 。从小到大输出前 ...
分类:
其他好文 时间:
2020-07-12 19:05:09
阅读次数:
54
(https://leetcode-cn.com/problems/count-of-smaller-numbers-after-self/) 可以这样想:我们把nums数组中的数都放在数轴上,那么我们根据某个数,看他数轴前边有多少个数就可以得到对应的count,这样会存在三个问题: 问题一:怎么保 ...
分类:
其他好文 时间:
2020-07-11 19:10:27
阅读次数:
53