8000 GitHub - kkasaija/Recursion: Practicing Recursion
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

kkasaija/Recursion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to solve this challenge?

  1. Read the "Challenge description" below.
  2. Make changes to the challenge.js file.
  3. Commit your changes.
  4. Wait for the result of the "GitHub Classroom Workflow" action. If it is green - congratulations, you solved this challenge! If not - try again!
  5. You can watch an example of how to solve a challenge in the video linked in the theoretical lesson preceding this challenge.

Challenge description

Basic Recursion

You will be given a positive integer number . Fill in the method sum so that it adds up all the positive integers up to number and returns the sum. For example, when given 4 it should return 10 (4+3+2+1).

While there are other ways to solve this challenge, you should use recursion to get the sum.

Examples

console.log(sum(4))
// => (4 + 3 + 2 + 1) = 10

console.log(sum(10))
// => 55

Get stuck and need some hint? Check this link: https://gitlab.com/microverse/guides/coding_challenges/hints/blob/master/challenges/recursion/basic-recursion.md

Troubleshooting

If you cannot see any auto-grading workflows on the Actions page, learn how to fix it in this repo.

About

Practicing Recursion

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  
0