Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

tommy huynh
seal-mask
.a{fill-rule:evenodd;}techdegree
tommy huynh
Full Stack JavaScript Techdegree Student 3,723 Points

Need help with process of solving a coding challenge

I was able to solve the coding challenge with some help from a co worker. After solving it I understand how the code works but my process to getting to the solution was all over the place.

For the following challenge, can you give me a step by step thought process of how you would go about solving this challenge?

Write a method that takes an integer `n` in; it should return: 

n*(n-1)*(n-2)*...*2*1      

Assume n >= 0. 

And as s a special case, `factorial(0) == 1`.