Created
February 22, 2018 00:53
-
-
Save jackbravo/e8b6798289148a0684f0a41fd0cc74ee to your computer and use it in GitHub Desktop.
PHP Anagram exercise
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*** | |
# Anagram clasification | |
## Concepts | |
Anagrams are words with exactly the same letters in different order | |
e.g., AMOR, ROMA, and MORA | |
## What we need | |
Write a function that... | |
- receives an Array of words | |
- prints the words found in the Array | |
- each set of anagrams on a line | |
- separate words with ' - ' | |
## Example | |
``` | |
// | |
// Given: | |
// ['AMOR', 'XISELA', 'JAMON', 'ROMA', 'OMAR', 'MORA', 'ESPONJA', 'RAMO', 'JAPONES', 'ARMO', 'MOJAN', 'MARO', 'ORAM', 'MONJA', 'ALEXIS'] | |
==> Prints: | |
// AMOR - ROMA - OMAR - MORA - RAMO - ARMO - MARO - ORAM | |
// MONJA - JAMON - MOJAN | |
// ESPONJA - JAPONES | |
// ALEXIS - XISELA | |
``` | |
***/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment