摘要:
简单位运算模拟 class Solution { public: int findKOr(vector<int>& nums, int k) { vector<int> bit(32, 0); for(int i = 0; i < 31; i ++ ) { int cnt = 0; for(auto 阅读全文
posted @ 2023-10-29 15:22
深渊之巅
阅读(21)
评论(0)
推荐(0)
摘要:
本题为双指针和贪心。当我们遇到奇数个0或1时,直接将下一位改变即可。 class Solution { public: int minChanges(string s) { int n = s.size(); int res = 0; int l = 0, r = -1; while(r ++ < 阅读全文
posted @ 2023-10-29 10:23
深渊之巅
阅读(21)
评论(0)
推荐(0)

浙公网安备 33010602011771号