<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Design HashMap on Dmytro&#39;s Blog</title>
    <link>https://dmytros.blog/tags/design-hashmap/</link>
    <description>Recent content in Design HashMap on Dmytro&#39;s Blog</description>
    <image>
      <title>Dmytro&#39;s Blog</title>
      <url>https://dmytros.blog/images/papermod-cover.png</url>
      <link>https://dmytros.blog/images/papermod-cover.png</link>
    </image>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Sat, 18 Jul 2026 08:52:24 +0300</lastBuildDate>
    <atom:link href="https://dmytros.blog/tags/design-hashmap/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>LeetCode - Design HashMap</title>
      <link>https://dmytros.blog/posts/leetcode-design-hashmap/</link>
      <pubDate>Sat, 18 Jul 2026 08:52:24 +0300</pubDate>
      <guid>https://dmytros.blog/posts/leetcode-design-hashmap/</guid>
      <description>&lt;h3 id=&#34;the-problem&#34;&gt;The problem&lt;/h3&gt;
&lt;p&gt;Design a HashMap without using any built-in hash table libraries.&lt;/p&gt;
&lt;p&gt;Implement the &lt;code&gt;MyHashMap&lt;/code&gt; class:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;MyHashMap()&lt;/code&gt; initializes the object with an empty map.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;void put(int key, int value)&lt;/code&gt; inserts a &lt;code&gt;(key, value)&lt;/code&gt; pair into the HashMap. If the &lt;code&gt;key&lt;/code&gt; already exists in the map, update the corresponding &lt;code&gt;value&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;int get(int key)&lt;/code&gt; returns the &lt;code&gt;value&lt;/code&gt; to which the specified &lt;code&gt;key&lt;/code&gt; is mapped, or &lt;code&gt;-1&lt;/code&gt; if this map contains no mapping for the &lt;code&gt;key&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
