Retired

Guess the list pattern #2 (retired)

8 of 14Beast

Description:

Make a function called "pattern" that takes two integers as input and returns the correct pattern as a list.

Four examples are shown below:

pattern(30, 7) = [-1, -8, -3, -2, -1]

pattern(-15, -4) = [3, -2, 0, -1]

pattern(23, 3) = [-3, -8, -4, -1, -4, -2, -1, -1]

pattern(-27, -5) = [2, -5, 0, -4, 1, -1]

Hint: Range, Step, Operators, Sum

Fundamentals
Lists
Data Structures
Mathematics
Arrays
Puzzles

Similar Kata:

More By Author:

Check out these other kata created by Beast

Stats:

CreatedSep 14, 2017
Warriors Trained181
Total Skips44
Total Code Submissions227
Total Times Completed14
Python Completions8
Ruby Completions1
JavaScript Completions7
CoffeeScript Completions1
PHP Completions2
Total Stars3
% of votes with a positive feedback rating30% of 5
Total "Very Satisfied" Votes1
Total "Somewhat Satisfied" Votes1
Total "Not Satisfied" Votes3
Total Rank Assessments4
Average Assessed Rank
4 kyu
Highest Assessed Rank
3 kyu
Lowest Assessed Rank
5 kyu
Ad
Contributors
  • Beast Avatar
Ad