Hash Map on Software Engineering Blog
https://jessechaulk.com/tags/hash-map/
Recent content in Hash Map on Software Engineering Bloghttps://jessechaulk.com/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E
https://jessechaulk.com/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E
Hugo -- gohugo.ioenSun, 16 Apr 2023 19:49:05 -0600Leetcode 3: Longest Substring Without Repeating Characters
https://jessechaulk.com/posts/3-longest-substring-without-repeating-characters/
Sun, 16 Apr 2023 19:49:05 -0600https://jessechaulk.com/posts/3-longest-substring-without-repeating-characters/Problem Statement Description Given a string my_str, find the length of the longest substring without repeating characters.
Examples Example 1: Input: s = "abcabcbb" Output: 3 Explanation: The answer is "abc", with the length of 3. Example 2: Input: s = "bbbbb" Output: 1 Explanation: The answer is "b", with the length of 1. Example 3: Input: s = "pwwkew" Output: 3 Explanation: The answer is "wke", with the length of 3.Leetcode 217: Contains Duplicates
https://jessechaulk.com/posts/217-contains-duplicates/
Wed, 18 Jan 2023 12:38:44 -0700https://jessechaulk.com/posts/217-contains-duplicates/Problem Statement Description Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct.
Examples Example 1: Input: nums = [1,2,3,1] Output: true Example 2: Input: nums = [1,2,3,4] Output: false Example 3: Input: nums = [1,1,1,3,3,4,3,2,4,2] Output: true Constraints 1 <= nums.length <= 105 -109 <= nums[i] <= 109 Key Insights This is a very simple problem that introduces the concept of a hash set.Leetcode 169: Majority Element
https://jessechaulk.com/posts/169-majority-element/
Mon, 16 Jan 2023 12:13:45 -0700https://jessechaulk.com/posts/169-majority-element/Problem Statement Description Given an array nums of size n, return the majority element.
The majority element is the element that appears more than ⌊n / 2⌋ times. You may assume that the majority element always exists in the array.
Examples Example 1: Input: nums = [3,2,3] Output: 3 Example 2: Input: nums = [2,2,1,1,1,2,2] Output: 2 Constraints n == nums.length 1 <= n <= 5 * 104 -109 <= nums[i] <= 109 Key Insights There are many different ways to solve this problem.