Skip to content

A solution for finding words started by a string. It works well on both front-end and back-end.

License

Notifications You must be signed in to change notification settings

EvandroLG/find-by-words

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

find-by-words

A solution for finding words started by a string. It works well on both front-end and back-end.

How does it work?

This implementation is inspired by the binary search algorithm. Like the famous algorithm, this solution uses the divide-and-conquer strategy and when it finds the first item, it searches for items on the left and right, stopping the loop when the first attempt fails.

Installation

npm install find-by-words

Parameters

  • wordsList Array
  • word String
  • caseSensitive Boolean (false by default)

How to use?

findByWords(['python', 'ruby', 'java', 'javascript', 'lua'], 'Java', true);
// output: ['java', 'javascript']

About

A solution for finding words started by a string. It works well on both front-end and back-end.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published