Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

Set-up

To set up the project please use the package manger of your choice

NPM:

npm i, npm install

Yarn:

yarn

Testing

To test use the following command:

<package manager> test

Because Jest is being used, please be sure to read the instructions in the command line, or press a to run all tests

Challenges

Number Search Challenge

For the given function

numberSearch(str: string): number

search a string for all given numbers in that string and return the sum of them rounded to the whole nearest number

e.g.

numberSearch("1 L0v3 CaNdy).should().be(4)

Addictive Persistent Challenge

For the given function

addictivePersistent(num: number): number

take the number passed which is always a positive integer, and return its additive persistence which is the number of times you must add the digits in number until you reach a single digit.

eg

addictivePersistent(9876).should().be(2);
// 9+8 + 7+6 = 30
// 3 + 0 = 3

String Reduction Challenge

For the given function

StringReduction(str: string): string

return the smallest number you can get through the following reduction method, The method is: Only the letters a, b, and c will be given in str and you must take two different adjacent characters and replace it with the third.

For example a string given as abc can be simplified to cc but no further. another example “aba” could be simplified to “ca” and then to “b.”

test case example

StringReduction(“abcabc”).should().be(2)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages