题目:https://leetcode-cn.com/problems/ju-zhen-zhong-de-lu-jing-lcof/submissions/ 代码: class Solution { public boolean exist(char[][] board, String word) ...
分类:
其他好文 时间:
2020-12-03 12:21:11
阅读次数:
6
题目 74. 搜索二维矩阵 思路1(暴力) 遍历二维数组的所有的元素,看看是否存在target 代码 class Solution { public boolean searchMatrix(int[][] matrix, int target) { for (int i = 0; i < matr ...
分类:
其他好文 时间:
2020-12-03 11:50:12
阅读次数:
4
此博客连接:https://www.cnblogs.com/ping2yingshi/p/14054440.html 存在重复元素2 题目链接:https://leetcode-cn.com/problems/contains-duplicate-ii/submissions/ 题目 给定一个整数数 ...
分类:
其他好文 时间:
2020-12-03 11:48:40
阅读次数:
2
快排与TopK 问题都可以用partition解决,所以这里将两者放在一起进行总结 topK 问题 #include<vector> #include<iostream> #include<algorithm> using namespace std; class Solution{ public: ...
分类:
其他好文 时间:
2020-12-02 12:25:31
阅读次数:
4
problem 给出 \(n\) 个互不包含的字符串,要求你求出一个最短的字符串 \(S\),使得这 \(n\) 个字符串在 \(S\) 中总共至少出现 \(m\) 次,问 \(S\) 最短是多少。 solution 我们首先转化题意: 有 \(n\) 个点,两个点 \(i,j\) 之间的权值为将第 ...
分类:
其他好文 时间:
2020-12-02 11:59:30
阅读次数:
3
call 有一个非常 \(\text{Naive}\) 的 \(O(nQ)\) 暴力,把类型 $1,2$ 的函数直接合并到类型 $3$ 上,对于 $2$ 函数直接乘,对于 $1$ 函数计算 $2$ 函数对 $1$ 函数的贡献,将单点加的数对 \((x,y)\) 记录在类型 $3$ 的函数的 \(\t ...
分类:
其他好文 时间:
2020-12-01 12:23:03
阅读次数:
5
一.平台方式: [DESCRIPTION]?关于LCM旋转180度,MTK提供一种新的方法,通过硬件OVL来实现。该方法会影响同一份load中的所有屏。 [SOLUTION] 配置方法: LK中: bootable/bootloader/lk/project/$project.mk MTK_LCM_ ...
分类:
其他好文 时间:
2020-11-30 16:01:41
阅读次数:
9
###题目 1287. Element Appearing More Than 25% In Sorted Array ###解题方法 遍历数组,找到出现次数最多的那个数即可。 时间复杂度:O(n) 空间复杂度:O(1) ###代码 class Solution: def findSpecialIn ...
分类:
移动开发 时间:
2020-11-30 15:53:35
阅读次数:
10
1.上升下降字符串 1 class Solution: 2 def sortString(self, s): 3 num = [0] * 26 4 for ch in s: 5 num[ord(ch) - ord('a')] += 1 6 7 ret = list() 8 while len(ret ...
分类:
其他好文 时间:
2020-11-30 15:46:10
阅读次数:
5
【写在前面的话】 最近学习不在状态,又遇上期末考试,每年到了这个时候都是最艰难的时候,唉。。。。。。之前就了解过 异或操作 但一直没有形成体系,今天做题又遇到了,想着自己整理一下吧。 【Part 1】异或操作 1.何为异或操作 异或是一种基于二进制的位运算,用符号XOR或者 ^ 表示,其运算法则是对 ...
分类:
其他好文 时间:
2020-11-30 15:20:57
阅读次数:
5