摘要:
第一题 题目链接:https://leetcode.cn/problems/diao-zheng-shu-zu-shun-xu-shi-qi-shu-wei-yu-ou-shu-qian-mian-lcof/ 个人题解: 用两个指针来移动。 \(i\) 和 \(j\) 分别表示奇数和偶数,从头遍历进 阅读全文
posted @ 2022-05-15 13:43
黑VS白-清墨
阅读(23)
评论(0)
推荐(0)
摘要:
题目链接:https://leetcode.cn/problems/largest-triangle-area/ 个人题解:暴力+叉积 代码: class Solution { public: int cross(int x1,int y1,int x2,int y2){ return x1*y2- 阅读全文
posted @ 2022-05-15 09:30
黑VS白-清墨
阅读(26)
评论(0)
推荐(0)
摘要:
只会写前两题,太菜了,第三题改bug改不出来,第四题属于看都没看了 第一题 题目链接:https://leetcode.cn/problems/find-the-k-beauty-of-a-number/ 个人题解: 首先把整数转化为字符串 遍历字符串,每次取出长度为 \(k\) 的子字符串 子字符 阅读全文
posted @ 2022-05-15 09:24
黑VS白-清墨
阅读(22)
评论(0)
推荐(0)