。。
爱编程的jj乐!
这个作者很懒,什么都没留下…
展开
-
JSP 引入css样式无效问题
在尝试网上几乎所有问题之后,例如给css加入字符编码,重新配置tomcat等之后。最后发现如果你的jsp文件头部有这个 直接删掉jsp文件就能引入css样式了。原创 2020-10-06 11:25:26 · 649 阅读 · 3 评论 -
几道leetcode
219. 存在重复元素 II class Solution { public: bool containsNearbyDuplicate(vector<int>& nums, int k) { if(nums.size()==0) return false; unordered_map<int,int>map; for(int i=0;i<nums.size();i++) {原创 2020-07-30 21:27:18 · 134 阅读 · 0 评论 -
leecode172 -217
172. 阶乘后的零 class Solution { public: int trailingZeroes(int n) { long int i=0; while(n) { i+=n/5; n=n/5; } return i; } }; 这里根据数据归纳法,发现10只能由2和5相乘得到,所以只需要数2和5得个数就可以了,但是又发现2得个数肯定是比5要大得,所以原创 2020-07-26 21:57:14 · 157 阅读 · 0 评论 -
奥里给,干了兄弟们。
昨天有点事情,没有写博客,不过还是刷了题的,所以今天的博客是昨天和昨天两天的总和。 121. 买卖股票的最佳时机 class Solution { public: int maxProfit(vector<int>& prices) { int inf = 1000000; int minprice = inf, maxprofit = 0; for (int price: prices) { maxprof原创 2020-07-23 22:16:12 · 164 阅读 · 0 评论 -
keep going
leecode 108 class Solution { public: TreeNode* sortedArrayToBST(vector<int>& nums) { int len= nums.size(); return dfs(nums,0,len); } TreeNode* dfs(vector<int>&nums,int left,int right) { if(原创 2020-07-21 21:59:38 · 385 阅读 · 0 评论 -
三道半leecode简单题。
leecode100 这是一道运用递归调用的题,最重要的是考虑好判断条件和调用cmp函数 class Solution { public: bool isSameTree(TreeNode* p, TreeNode* q) { if(q==NULL&&p==NULL) { return true; } if(q==NULL||p==NULL) { retur原创 2020-07-18 22:11:29 · 135 阅读 · 0 评论