Skip to content

pcerbino/challenge-words-circle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

Challenge Words Circle

Challenge task

Given a list of words, determine whether the words can be chained to form a circle. A word X can be placed in front of another word Y in a circle if the last character of X is same as the first character of Y. For example, the words ['chair', 'height', 'racket', touch', 'tunic'] can form the following circle: chair --> racket --> touch --> height --> tunic --> chair The output it has to be a txt file with one word per line, ex: chair racket touch height tunic Is very important the logic and the performance of the algorithm.

Installation and setup

  • Clone this repo and execute from console.
$ php challenge.php
  • You can change filename output updating FILENAME constant.
  • At the top of script are differents datasets to test.

More information

  • Tested with more than 500000 words
  • Same problem with alternative solutions here

Author and contact

Pablo Cerbino [email protected]

About

Test for COR

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages