- Files
-
anagrams.php
-
class/StringUtils.php
-
Functions in Class
StringUtils
- anagrams (return all anagrams if exist)
- is_anagram (detect if 2 string are anagrams
- is_anagram_another_way (not in use in this test just for ilustrate another solution)
-
run
composer install
#php anagrams.php "tree" ["terse","steer"]
Array used
$words = ["tumblr", "terse", "rest", "tears", "steer", "street"];