Skip to content

Instantly share code, notes, and snippets.

@ChazAttack73
Forked from jaywon/gist:c76abc57dc33e1679c02
Created December 5, 2015 20:58
Show Gist options
  • Save ChazAttack73/8ce66bde85e214d010a0 to your computer and use it in GitHub Desktop.
Save ChazAttack73/8ce66bde85e214d010a0 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