6 kyu
Peel the onion
90 of 263Kees de Vreugd
Description:
Peel the onion
Your function will receive two positive integers ( integers ranging from 1 upward), and return an array. There's logic in there, but all you get are the example test cases to find it. Below overview for your convenience. (And, alright: the function name is a strong hint of what to do.)
(s, d) => array
(1, 1) => [1]
(2, 1) => [2]
(3, 1) => [2, 1]
(4, 1) => [2, 2]
(5, 1) => [2, 2, 1]
(1, 2) => [1]
(2, 2) => [4]
(3, 2) => [8, 1]
(4, 2) => [12, 4]
(5, 2) => [16, 8, 1]
(1, 3) => [1]
(2, 3) => [8]
(3, 3) => [26, 1]
(4, 3) => [56, 8]
(5, 3) => [98, 26, 1]
(1, 4) => [1]
(2, 4) => [16]
(3, 4) => [80, 1]
(4, 4) => [240, 16]
(5, 4) => [544, 80, 1]
Algorithms
Puzzles
Mathematics
Logic
Similar Kata:
Stats:
Created | Jul 23, 2021 |
Published | Jul 23, 2021 |
Warriors Trained | 1146 |
Total Skips | 26 |
Total Code Submissions | 1025 |
Total Times Completed | 263 |
JavaScript Completions | 90 |
Python Completions | 157 |
Java Completions | 30 |
Haskell Completions | 9 |
Total Stars | 37 |
% of votes with a positive feedback rating | 86% of 59 |
Total "Very Satisfied" Votes | 47 |
Total "Somewhat Satisfied" Votes | 8 |
Total "Not Satisfied" Votes | 4 |
Total Rank Assessments | 7 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 7 kyu |