#rom

Android Rom修改

  最近项目里要实现修改开机动画屏蔽系统桌面等一些涉及到修改底层的功能一开始研究了一番心想着看来这是要定制系统做rom开发了所以就牛逼哄哄的跑去下源码研究rom开发后来发现这将是一个庞大的工程不是我一个人能搞定的就只能想别的法子啦!   思路就是下载现成的rom进行修改...
代码星球 代码星球·2020-10-21

leetcode 266.Palindrome Permutation 、267.Palindrome Permutation II

266.PalindromePermutationhttps://www.cnblogs.com/grandyang/p/5223238.html判断一个字符串的全排列能否形成一个回文串。能组成回文串,在字符串长度为偶数的情况下,每个字符必须成对出现;奇数的情况下允许一个字符单独出现,其他字符都必须成对出现。用一个se...

leetcode 542. 01 Matrix 、663. Walls and Gates(lintcode) 、773. Sliding Puzzle 、803. Shortest Distance from All Buildings

542.01Matrixhttps://www.cnblogs.com/grandyang/p/6602288.html将所有的1置为INT_MAX,然后用所有的0去更新原本位置为1的值。最短距离肯定使用bfs。每次更新了值的地方还要再加入队列中。classSolution{public:vector<vecto...

leetcode 131. Palindrome Partitioning 、132. Palindrome Partitioning II

131.PalindromePartitioning 一个字符串,通过不同的切分找到所有切分后的子字符串都是回文的可能性substr使用的是坐标值,不使用.begin()、.end()这种迭代器使用dfs,类似于subsets的题,每次判断要不要加入这个数start每次是起始的位置,判断当前位置到起始位置是不...

5. Longest Palindromic Substring

https://www.cnblogs.com/grandyang/p/4464476.html用动态规划做classSolution{public:stringlongestPalindrome(strings){if(s.empty())return"";intdp[s.size()][s.size()]={0};...
代码星球 代码星球·2020-10-13

https://leetcode.com/problems/palindromic-substrings/description/

https://www.cnblogs.com/grandyang/p/7404777.html博客中写的<=2,实际上<=1也是可以的相当于判断一个大指针内所有子字符串是否可能为回文classSolution{public:intcountSubstrings(strings){intlength=s.s...

234. Palindrome Linked List

https://www.cnblogs.com/grandyang/p/4635425.html错误代码:while(last->next){ListNode*tmp=last->next;last->next=tmp->next;slow->next=tmp;tmp->next=l...
代码星球 代码星球·2020-10-13

leetcode 19. Remove Nth Node From End of List

 这个题和剑指上的倒数第k个结点略微有点不一样,找到倒数第k个只需要移动n-1次,但删除倒数第k个需要移动n次,因为需要找到倒数第k个后面那个还有如果k值大于等于了长度,返回的是head的next注意p2->next=p2->next->nextclassSolution{public:Li...

leetcode 125. Valid Palindrome

  classSolution{public:boolisPalindrome(strings){intlength=s.length();if(length<=0)returntrue;intleft=0;intright=length-1;while(left<right){whil...

剑指offer 最小的k个数 、 leetcode 215. Kth Largest Element in an Array 、lintcode 80. Median、295. Find Median from Data Stream(剑指 数据流中位数) topK

  注意multiset的一个bug:multiset带一个参数的erase函数原型有两种。一是传递一个元素值,如上面例子代码中,这时候删除的是集合中所有值等于输入值的元素,并且返回删除的元素个数;另外一种是传递一个指向某个元素的iterator,这时候删除的就是这个对应的元素,无返回值。https...

chrome ubuntu启动不了

安装好后,点击图标没反应用命令行运行chrome并显示log:google-chrome--enable-logging=stderr--log-level=4报错如下:解决:安装更高版本的NSSsudoapt-getinstalllibnss3...
代码星球 代码星球·2020-10-13

132. Palindrome Partitioning II

 初始化技巧: 在做字符串的dp时,对一个长度为n的字符串,往往要开n+1的空间,把0那一位留出来。因为定义前i个字符,自然分为前0个字符,前1个字符,前n个字符。前0的空串不能忽略,空串很重 要,很多的结果是从空串来的。classSolution{public:intminCut(str...

leetcode 105. Construct Binary Tree from Preorder and Inorder Traversal,剑指offer 6 重建二叉树

不用迭代器的代码classSolution{public:TreeNode*reConstructBinaryTree(vector<int>pre,vector<int>vin){TreeNode*root=NULL;intlength_pre=pre.size();intlength_vin...

Prometheus监控系统 安装与配置详细教程

一、Prometheus是什么Prometheus中文发音为普罗米修斯,它可以使用各种数学算法实现强大的监控需求,并且原生支持K8S的服务发现,能监控容器的动态变化。结合Grafana绘出漂亮图形,最终使用alertmanager或Grafana实现报警。它与其他监控相比有以下主要优势:数据格式是Key/Value形式...

Prometheus监控安装及使用(一)

原理就不多说了,直接上操作过程吧PrometheusPushGateway 参考: https://github.com/prometheus/pushgatewayPrometheusServer 参考: https://github.com/prometheus/promet...
首页上一页...3839404142...下一页尾页