Problem
Contains Duplicate is an easy level problem, and is #242 on Leetcode. For the full description, see here. In Valid Anagram, you are given two strings s
and t
, where the goal is to return True
if the two strings are anagrams of each other, and False
otherwise.
An anagram is a word or phrase formed by rearranging the letters of another. Take, for example, the word anagram
and the nonsensical aaagnram
. Since they both use the same set of letters to form a ‘word’, they are considered an anagram (in our case, where we aren’t worried about coherence).
The amount of ways you can approach this problem was smaller than I had expected, with there essentially being