Anagram

Anagram

Easy

Instructions

An anagram is a rearrangement of letters to form a new word. Given a word and a list of candidates, select the sublist of anagrams of the given word.

Given "listen" and a list of candidates like "enlists" "google" "inlets" "banana" the program should return a list containing "inlets".

The skipped tests near the bottom of the anagram_test.php are Stretch Goals, they are optional. They require the usage of mb_string functions, which aren't installed by default with every version of PHP.

Last updated 25 May 2022
Edit via GitHub The link opens in a new window or tab
PHP Exercism

Ready to start Anagram?

Sign up to Exercism to learn and master PHP with 79 exercises, and real human mentoring, all for free.