Created
October 27, 2024 12:30
-
-
Save alxpsr/5de99c4562907c512c6548c49aea00ec to your computer and use it in GitHub Desktop.
Search file task
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Implement function `searchFile`. You give a substring, functions returns true if query satisfied to filename or false; | |
searchFile('crdle', 'crocodile.txt') // true | |
searchFile('le', 'crocodile.txt') // true | |
searchFile('el', 'crocodile.txt') // false | |
searchFile('coco', 'crocodile.txt') // true | |
searchFile('crdleee', 'crocodile.txt') // false | |
searchFile('crkdl', 'crocodile.txt') // false | |
Tip: `two pointers` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment