Stack Bash - Master data structures and algorithms

String match

Medium
Let's say you want to know if a string contains a substring.
Python has built-in methods that can do this for us:
matches = some_substring in main_string # either True or False
But how is this implemented under the hood?
Write a function that implements this functionality.
For example, if your function is given the arguments bitcoin and coin, your function should return True.
But if you're given bitcoin and usd, your function should return False.

Try it

Solution

6 Essential Strings Coding Interview Problems

Master Strings by trying the coding challenges below.
  1. 1.Reverse StringEasy
  2. 2.AnagramEasy
  3. 3.Reverse wordsMedium
  4. 4.String matchMedium
  5. 5.CompressionMedium
  6. 6.One edit awayHard

Want to confidently pass your next coding interview?

Stack Bash helps new and veteran software engineers master data structures and algorithms for technical interviews.