摘要: 题目链接:https://leetcode-cn.com/problems/da-yin-cong-1dao-zui-da-de-nwei-shu-lcof/ class Solution { public: vector<int> printNumbers(int n) { vector<int> 阅读全文
posted @ 2020-04-20 16:51 NaughtyCoder 阅读(62) 评论(0) 推荐(0)
摘要: 题目链接:https://leetcode-cn.com/problems/bu-ke-pai-zhong-de-shun-zi-lcof/ 思路 时间复杂度:O(nlogn) 空间复杂度: O(1) 将数据排序 第一次遍历数组(过滤掉有重复元素的),如果遇到非0元素,并且前后两个数相等,说明不是顺 阅读全文
posted @ 2020-04-20 16:35 NaughtyCoder 阅读(74) 评论(0) 推荐(0)
摘要: 题目链接:https://leetcode-cn.com/problems/gou-jian-cheng-ji-shu-zu-lcof/ 时间复杂度O(n) 空间复杂度O(1) class Solution { public: vector<int> constructArr(const vecto 阅读全文
posted @ 2020-04-20 16:32 NaughtyCoder 阅读(69) 评论(0) 推荐(0)
摘要: 题目链接:https://leetcode-cn.com/problems/bu-yong-jia-jian-cheng-chu-zuo-jia-fa-lcof/ 位运算 分析十进制是如何做加法的?以5 + 17为例说明 1. 只做各位相加不进位 个位:5 + 7 = 12, 不要进位是2,十位: 阅读全文
posted @ 2020-04-20 15:57 NaughtyCoder 阅读(101) 评论(0) 推荐(0)