A Puzzling Algorithm

This algorithm is based on:

Test Plan

To understand what this algorithm is meant to do, we will predict its expected output for different input values and record our predicted outputs in a test plan.

Test # Input Values Expected Output
#1 a = 7
b = 2
#1 a = 3
b = 9
#1 a = 150
b = 10

Now that you have completed the “expected output” column of this test plan you might be able to explain what this algorithm actually does?

You can now use trinket.io to implement this algorithm and complete each test from the above test plan.



The solution for this challenge is available to full members!
Find out how to become a member:
➤ Members' Area

Did you like this challenge?

Click on a star to rate it!

Average rating 2.6 / 5. Vote count: 21

No votes so far! Be the first to rate this post.

As you found this challenge interesting...

Follow us on social media!