<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>LeetCode on Niweea’s Blog</title><link>https://niweea.github.io/tags/leetcode/</link><description>Recent content in LeetCode on Niweea’s Blog</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sun, 07 Jun 2026 10:00:00 +0800</lastBuildDate><atom:link href="https://niweea.github.io/tags/leetcode/index.xml" rel="self" type="application/rss+xml"/><item><title>你必须知道的位运算</title><link>https://niweea.github.io/posts/bit_operation/</link><pubDate>Fri, 04 Jun 2021 18:35:04 +0800</pubDate><guid>https://niweea.github.io/posts/bit_operation/</guid><description>&lt;p&gt;位运算直接操作二进制位，在判断性质、压缩状态和优化性能时非常高效。下面整理几个实用技巧与对应 LeetCode 题目。&lt;/p&gt;&#10;&lt;h2 id="检测两个整数是否符号相反" class="relative group"&gt;检测两个整数是否符号相反 &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100"&gt;&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#%e6%a3%80%e6%b5%8b%e4%b8%a4%e4%b8%aa%e6%95%b4%e6%95%b0%e6%98%af%e5%90%a6%e7%ac%a6%e5%8f%b7%e7%9b%b8%e5%8f%8d" aria-label="Anchor"&gt;#&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;^&lt;/code&gt;（异或）两值对应位不同时结果为 1。&lt;/p&gt;</description></item><item><title>爱生气的书店老板（LeetCode 1052）</title><link>https://niweea.github.io/posts/leetcode/grumpy_bookstore_owner/</link><pubDate>Wed, 24 Feb 2021 18:10:06 +0800</pubDate><guid>https://niweea.github.io/posts/leetcode/grumpy_bookstore_owner/</guid><description>&lt;p&gt;今天，书店老板有一家店打算试营业 customers.length 分钟。每分钟都有一些顾客（customers[i]）会进入书店，所有这些顾客都会在那一分钟结束后离开。&lt;/p&gt;&#10;&lt;p&gt;在某些时候，书店老板会生气。 如果书店老板在第 i 分钟生气，那么 grumpy[i] = 1，否则 grumpy[i] = 0。 当书店老板生气时，那一分钟的顾客就会不满意，不生气则他们是满意的。&lt;/p&gt;</description></item></channel></rss>