<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>力扣 on 范彼得</title>
    <link>/tags/%E5%8A%9B%E6%89%A3/</link>
    <description>Recent content in 力扣 on 范彼得</description>
    <generator>Hugo</generator>
    <language>zh-cn</language>
    <lastBuildDate>Thu, 09 Apr 2026 14:00:00 +0800</lastBuildDate>
    <atom:link href="/tags/%E5%8A%9B%E6%89%A3/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>6-力扣速刷</title>
      <link>/posts/6-%E5%8A%9B%E6%89%A3%E9%80%9F%E5%88%B7/</link>
      <pubDate>Thu, 09 Apr 2026 14:00:00 +0800</pubDate>
      <guid>/posts/6-%E5%8A%9B%E6%89%A3%E9%80%9F%E5%88%B7/</guid>
      <description>&lt;h1 id=&#34;欢迎来到我的博客&#34;&gt;&#xA;  欢迎来到我的博客&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e6%ac%a2%e8%bf%8e%e6%9d%a5%e5%88%b0%e6%88%91%e7%9a%84%e5%8d%9a%e5%ae%a2&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h1&gt;&#xA;&lt;p&gt;力扣速刷&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;开始写博客&#34;&gt;&#xA;  开始写博客&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e5%bc%80%e5%a7%8b%e5%86%99%e5%8d%9a%e5%ae%a2&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;h2 id=&#34;一哈希&#34;&gt;&#xA;  一、哈希&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e4%b8%80%e5%93%88%e5%b8%8c&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;strong&gt;两数之和&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;class Solution {&#xA;public:&#xA;vector&amp;lt;int&amp;gt; twoSum(vector&amp;lt;int&amp;gt;&amp;amp; nums, int target) {&#xA;    int n = nums.size();&#xA;    // 外层循环：选定第一个数 nums[i]&#xA;    for (int i = 0; i &amp;lt; n; i++) {&#xA;        for (int j = i + 1; j &amp;lt; n; j++) { &#xA;            if (nums[i] + nums[j] == target) {&#xA;                return {i, j}; // 找到了，直接返回它们的下标&#xA;            }&#xA;        }&#xA;    }&#xA;    return {}; // 没找到&#xA;}&#xA;};&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&lt;strong&gt;2.字母异位词分组&lt;/strong&gt;   3***&lt;/p&gt;</description>
    </item>
    <item>
      <title>7-哈希表链表</title>
      <link>/posts/7-%E5%93%88%E8%A5%BF%E8%A1%A8%E9%93%BE%E8%A1%A8/</link>
      <pubDate>Wed, 08 Apr 2026 14:00:00 +0800</pubDate>
      <guid>/posts/7-%E5%93%88%E8%A5%BF%E8%A1%A8%E9%93%BE%E8%A1%A8/</guid>
      <description>&lt;h1 id=&#34;欢迎来到我的博客&#34;&gt;&#xA;  欢迎来到我的博客&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e6%ac%a2%e8%bf%8e%e6%9d%a5%e5%88%b0%e6%88%91%e7%9a%84%e5%8d%9a%e5%ae%a2&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h1&gt;&#xA;&lt;p&gt;再也不想看力扣了，机器人运动控制为什么要考力扣呢？vibecoidng大行当道，非科班计算机真的没必要考力扣吧。但也没办法呢，考不过就刷掉了。&lt;/p&gt;&#xA;&lt;h2 id=&#34;哈希表&#34;&gt;&#xA;  哈希表&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e5%93%88%e5%b8%8c%e8%a1%a8&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt; unordered_map&amp;lt;string, int&amp;gt; phoneBook;&#xA;&#xA;    phoneBook[&amp;#34;张三&amp;#34;] = 13800138000;&#xA;    phoneBook[&amp;#34;李四&amp;#34;] = 13900139000;&#xA;    phoneBook[&amp;#34;王五&amp;#34;] = 13700137000;&#xA;    phoneBook[&amp;#34;赵六&amp;#34;] = 13600136000;&#xA;    phoneBook[&amp;#34;孙七&amp;#34;] = 13500135000;&#xA;&#xA;    phoneBook.insert({&amp;#34;周八&amp;#34;, 13400134000});&#xA;    phoneBook.insert({&amp;#34;吴九&amp;#34;, 13300133000});&#xA;    phoneBook.insert({&amp;#34;郑十&amp;#34;, 13200132000});&#xA;&#xA;    phoneBook.emplace(&amp;#34;钱十一&amp;#34;, 13100131000);&#xA;&#xA;&#xA; unordered_map&amp;lt;char, int&amp;gt; freq;&#xA;&#xA; unordered_map&amp;lt;int, int&amp;gt; map;&#xA;&#xA; unordered_map&amp;lt;string, int&amp;gt; count;  &#xA;&#xA; // key和value都可以随便设置 ，value 也可以是 string 什么的，不一定非得是 int&#xA; // 哈希表是没有顺序的 无序&#xA; // key 不能重复  value 可以&#xA; // 可以通过key 找value 无法通过value 找到key&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;// unordered_set 只关心&amp;#34;有没有&amp;#34;&#xA;// 像是一个无序 + 不可重复的数组！&#xA;// 每个元素只能出现一次&#xA;// 元素不按插入顺序存储&#xA;&#xA;unordered_set&amp;lt;string&amp;gt; fruits;&#xA;fruits.insert(&amp;#34;apple&amp;#34;);&#xA;fruits.insert(&amp;#34;banana&amp;#34;);&#xA;// 只存储: &amp;#34;apple&amp;#34;, &amp;#34;banana&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;hr&gt;&#xA;&lt;h2 id=&#34;链表&#34;&gt;&#xA;  链表&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e9%93%be%e8%a1%a8&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;是一个结构体。&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
