Skip to content

xebia/coding-challenge-typescript

Repository files navigation

Brief

Welcome to the Pascal's Triangle assignment. We hope you'll have fun!

Pascal's Triangle explanation

Pascal's Triangle is an infinite list of growing lists of numbers.

An example of the first 5 rows of Pascal's Triangle is as follows:

1
1 1
1 2 1
1 3 3 1
1 4 6 4 1

Each row is constructed as follows:

  • In row 0, the triangle starts with a single-element list with value 1.
  • Each subsequent row is constructed by adding the value above to the left with the value exactly above.
  • A value outside the previous row is counted as 0.

Objective

The objectives for this assignment is:

  • Find the bug in the triangleRow function. Look at the result of the test as a hint.
  • Remove the bug and make sure the tests pass.

Running the tests

Note

This project requires:

  • Node.js version 16 or higher
  • npm as package manager

You can download Node.js from nodejs.org

OR

Use nvm to manage your Node.js versions.

You can run all the tests by following these steps:

  1. First install the dependencies
npm i
  1. Then run the tests
npm test

Good luck!

All the best and happy coding,

The Xebia Team.

About

No description, website, or topics provided.

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •