Anagram Java Coding Challenge | Edabit | How'd You Code That?

Опубликовано: 26 Сентябрь 2026
на канале: Ed Clark
119
5

#anagram #java #howdyoucodethat #stringbuilder

In today’s challenge, we’re writing a method that takes two strings, and determines if an anagram of the first string is in the second string.

anaStrStr("car", "race") ➞ true

“Car” is an anagram of “race”, because all of the letters in the word “car” exist in the word “race”, contiguously.

anaStrStr("nod", "done") ➞ true

Nod is an anagram of the word done.

anaStrStr("bag", "grab") ➞ false

Although all of the letters in the word “bag” exist in the word “grab”, “bag” is not a contiguous word within “grab” because the ‘r’ in “grab” disrupts the continuity of the letters required to form the word “bag”.
Song: Sunny - Ikson (Vlog No Copyright Music)
Music promoted by Vlog No Copyright Music.
  / ikson