Skip to content
This repository has been archived by the owner on Dec 4, 2019. It is now read-only.

braxtondiggs/Caterpie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Caterpie Caterpie

Write a javascript function named “find_consecutive_runs” that accepts as an argument a list of integers.

  • It must find in that list all runs of 3 consecutive numbers that increase or decrease by 1
    • [ x, x+1, x+2 ] or [ x, x-2, x-3 ]
  • It should return the list indices of the first element of each run
  • If there are no consecutive runs it should output No Runs Found

Example Input: [1, 2, 3, 5, 10, 9, 8, 9, 10, 11, 7, 8, 7] Results: [0, 4, 6, 7]

Tasks

  1. This is an example of terrible UI design.
  • Make some improvements to the UI to make this more user friendly for input
  1. Implement the javascript function searchConsecutiveNumbers to achieve the solution for the question stated