Exercises
We will resolve one exercise from LeetCode using the map data structure to transform integer numbers to roman numbers.
However, there are many fun exercises available in LeetCode that we should be able to resolve with the concepts we learned in this chapter. Below are some additional suggestions you can try to resolve, and you can also find the solution along with the explanation within the source code from this book:
- 1. Two Sum: given an array of integers, find two numbers that add up to a target sum. This is a classic problem that introduces you to using a hash map to store complements and quickly find matches.
- 242. Valid Anagram: determine if two strings are anagrams of each other (contain the same characters but in a different order). Hash maps are useful for counting character frequencies.
- 705. Design HashSet: implement the hash set data structure.
- 706. Design HashMap: implement the hash map data structure.
- 13. Roman to Integer: similar to the problem we will resolve,...