Skip to content

Latest commit

 

History

History
32 lines (20 loc) · 652 Bytes

File metadata and controls

32 lines (20 loc) · 652 Bytes

Is substring

Nice to solve before

Instructions

Given two strings implement a function which determines whether the characters in the second string is a substring of the characters in the first string (check if second string exists as continuous/unbroken chain of characters the first string).

challenge | solution

Limitations

Don't use String.contains method.

Examples

isSubstring("go home", "ome") // true

isSubstring("go home", "me") // true

isSubstring("go home", "abc") // false

Hints

Hint 1 Use double pointer or recursion