Skip to content

This React application is utilized for solving two distinct challenges.

Notifications You must be signed in to change notification settings

Carolina-Riddick/challenge-BS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Challenge

This repository is about 2 different problems to analyze and resolve.

  1. Pairing spores
  2. Fibonacci

Clone the repository, open your Visual Studio Code, and then execute the following command npm start


About the two problems to be solved

Captura de pantalla 2023-11-08 a las 2 30 44 p  m

Pairing spores

  • There is a list of spores that need to be paired. Given an array of integers representing the identifier of each spore type, determine how many pairs of spores with matching identifiers there are.

Example

sporeIds = [1, 2, 1, 2, 1, 3, 2]

  • As shown in the picture, we have an input where we can introduce a number of spores separated by commas.
Captura de pantalla 2023-11-08 a las 2 57 22 p  m
  • In the picture, we can see that there is no pair number, which is why the number of pairs is 0.
  • If we add one more number according to the solution, we can see that the number of pairs change to 1
Captura de pantalla 2023-11-08 a las 2 31 40 p  m
  • As we continue to add more numbers based on those already inserted, the count of pair numbers will increase.
Captura de pantalla 2023-11-08 a las 3 06 28 p  m

Fibonacci Functions

  • I present three distinct approaches for solving the Fibonacci sequence.
  • The first two options involve the use of loops, while the third option employs a recursive function. It is important to note that, when dealing with large numbers, I do not recommend the recursive function approach, as it may encounter stack-related issues.

Option 1 -

Captura de pantalla 2023-11-08 a las 2 30 58 p  m

Option 2

Captura de pantalla 2023-11-08 a las 2 31 04 p  m

Recursive function

Captura de pantalla 2023-11-08 a las 2 31 26 p  m
  • As depicted in the image, when the number 8 is inputted, each of the three different options (1, 2, and 3) should yield the same result, which is 21.

About

This React application is utilized for solving two distinct challenges.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published