Skip to content

Latest commit

 

History

History
12 lines (8 loc) · 422 Bytes

File metadata and controls

12 lines (8 loc) · 422 Bytes

Simple arithmetic progression

Description

In this Kata, you will be given an array of integers and your task is to return the number of arithmetic progressions of size 3 that are possible from that list. In each progression, the differences between the elements must be the same. All inputs will be sorted

Examples

solve([1,2,3,5,7,9]) = 5, as follows: [1,2,3], [1,3,5],[1,5,9],[3,5,7], and [5,7,9].