摘要:题目链接:https://leetcode-cn.com/problems/minimum-time-to-type-word-using-special-typewriter/ 代码: /* 1974. 使用特殊打字机键入单词的最少时间 */ #include<iostream> #include
阅读全文
摘要:题目链接:https://leetcode-cn.com/problems/sort-integers-by-the-number-of-1-bits/ 代码: /* 给你一个整数数组 arr 。请你将数组中的元素按照其二进制表示中数字 1 的数目升序排序。 如果存在多个数字二进制中 1 的数目相同
阅读全文
摘要:题目链接:https://leetcode-cn.com/problems/print-zero-even-odd/ 代码参考链接:https://leetcode-cn.com/problems/print-zero-even-odd/solution/c-san-chong-fang-shi-b
阅读全文
摘要:/* * 题目: * 给定单向链表的头指针和一个节点指针,定义一个函数在O(1)时间内 * 删除该节点。 */ #include<iostream> using namespace std; //链表节点定义 struct ListNode { int m_nValue; ListNode* m_p
阅读全文
摘要:1.小端存储和大端存储的含义如下,就是数据在内存中的存储方式 2.判断自己电脑内存是小端存储还是大端存储的代码如下: #include<iostream> using namespace std; bool is_little_endian_machine() { union UN { char c
阅读全文