Skip to content

ROZ32/fun-with-anagrams

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fun-with-anagrams

Solution to the Hacker Rank problem 'Fun with Anagram' - JS

To run this npm start

Problem

Given an array of strings, remove each string that is an anagram of an earlier string, then return the remaining array in sorted order.

Example

str = ['code', 'doce', 'ecod', 'framer', 'frame']

code and doce are anagrams. Remove doce from the array and keep the first occurrence code in the array. code and ecod are anagrams. Remove ecod from the array and keep the first occurrence code in the array. code and framer are not anagrams. Keep both strings in the array. framer and frame are not anagrams due to the extra r in framer. Keep both strings in the array. Order the remaining strings in ascending order: ['code','frame','framer'].

About

Solution to the Hacker Rank problem 'Fun with Anagram' - JS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published