Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sgnl/0180cea3e7eacebd336cc39d285d0435 to your computer and use it in GitHub Desktop.
Save sgnl/0180cea3e7eacebd336cc39d285d0435 to your computer and use it in GitHub Desktop.
Circular String Brain Bender

###Good Morning Agents

Your challenge this morning is to create a function that implements an algorithm using the concepts we've covered this week.

###Challenge

  1. Write an algorithm that takes in 2 strings as parameters (source, find).
  2. Your function should return true if the string passed in as the find parameter is found in the source parameter if source were circular in nature. Meaning there is no end to the source string.
  3. Important: A match would be true if the word to find is partially at the end of the word and at the beginning in sequence.

Ex.

Source: Hotdog

Target: dog

Return: true

Source: Assignments

Target: sass

Return: true

Source: Assignments

Target: sassy

Return: false

####Please do NOT share your answer and if you move on do the following. And remember think outside the box as to what is possible but maybe not obvious.

Bonus mission: Write a blog post explaining closures as if you were explaining them to a child. Everyone should complete this task if it doesn't fit within the time of this morning's challenge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment