Retired

Guess the list pattern #1 (retired)

11 of 21Beast

Description:

Make a function called "pattern" that takes two integers as input and returns the correct pattern as a list. For this pattern the list accumulates from left to right using the mystery operator.

Four examples are shown below:

pattern(30, 7) = [0, 7, 9, 28, 0]

pattern(-15, -4) = [0, -4, 4, -16]

pattern(23, 3) = [0, 3, 5, 12, 0, 15, 29, 8]

pattern(-27, -5) = [0, -5, 13, -4, 16, -9]

Hint: Range, Step, Operator, Sum.

Fundamentals
Lists
Data Structures
Mathematics
Arrays
Puzzles

Similar Kata:

More By Author:

Check out these other kata created by Beast

Stats:

CreatedSep 13, 2017
Warriors Trained265
Total Skips52
Total Code Submissions411
Total Times Completed21
Python Completions11
Ruby Completions1
JavaScript Completions6
CoffeeScript Completions1
PHP Completions8
Total Stars5
% of votes with a positive feedback rating55% of 10
Total "Very Satisfied" Votes3
Total "Somewhat Satisfied" Votes5
Total "Not Satisfied" Votes2
Total Rank Assessments8
Average Assessed Rank
6 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • Beast Avatar
Ad