Two Strings Are Anagrams
Problem
Write a method anagram(s,t)
to decide if two strings are anagrams or not.
Example
Given s="abcd"
, t="dcab"
, return true.
Challenge
O(n)
time, O(1)
extra space.
Write a method anagram(s,t)
to decide if two strings are anagrams or not.
Given s="abcd"
, t="dcab"
, return true.
O(n)
time, O(1)
extra space.