6 kyu
Sum Up to Target Non Adjacents elements
112 of 168knotman90
Description:
Given an array of ints, check if is it possible to choose a group of some of the ints, such that the group sums to the given target with this additional constraint: If a value in the array is chosen to be in the group, the value immediately following it in the array must not be chosen.
For example:
[2, 5, 10, 4], 12 → true
[2, 5, 10, 4], 14 → false
[2, 5, 10, 4], 7 → false
Note: input length from 0 to 20.
Lists
Recursion
Fundamentals
Similar Kata:
Stats:
Created | Nov 1, 2014 |
Published | Nov 1, 2014 |
Warriors Trained | 550 |
Total Skips | 102 |
Total Code Submissions | 1706 |
Total Times Completed | 168 |
Haskell Completions | 112 |
JavaScript Completions | 62 |
Total Stars | 7 |
% of votes with a positive feedback rating | 84% of 48 |
Total "Very Satisfied" Votes | 35 |
Total "Somewhat Satisfied" Votes | 11 |
Total "Not Satisfied" Votes | 2 |