Skip to content

Latest commit

 

History

History

176-find2020

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

find2020

Interview question of the issue #176 of rendezvous with cassidoo.

The question

You’re given a string of characters that are only 2s and 0s. Return the index of the first occurrence of “2020” without using the indexOf (or similar) function, and -1 if it’s not found in the string.

Example:

$ find2020('2220000202220020200')
$ 14

Installing & Running

Just pnpm i to install all dependencies and then pnpm t to run the tests!