Is One String in the Other?

Published by supafly in

Create a function that takes two strings and returns true if either of the strings appears at the very end of the other string. Return false otherwise. The character * is a wildcard, so it can take the place of any character.

Examples

Overlap("ABC", "Ican'tsingmyABC") ➞ true

Overlap("abc", "Ican'tsingmyABC") ➞ true

Overlap("Ican'tsingmyABC", "abc") ➞ true

Overlap("hello world", "hello") ➞ false

Overlap("+=", "this should work too +=") ➞ true

Overlap("hey", "*********") ➞ true

Notes

Your function should NOT be case sensitive (see example #2).

Watch a quick demo on how Edabit works.