7 kyu
Integer Difference
1,284 of 3,099smepple
Description:
Write a function that accepts two arguments: an array/list of integers and another integer (n
).
Determine the number of times where two integers in the array have a difference of n
.
For example:
[1, 1, 5, 6, 9, 16, 27], n=4 --> 3 # (1,5), (1,5), (5,9)
[1, 1, 3, 3], n=2 --> 4 # (1,3), (1,3), (1,3), (1,3)
Fundamentals
Similar Kata:
Stats:
Created | Jun 29, 2016 |
Published | Jun 29, 2016 |
Warriors Trained | 6065 |
Total Skips | 215 |
Total Code Submissions | 27614 |
Total Times Completed | 3099 |
JavaScript Completions | 1183 |
Ruby Completions | 187 |
CoffeeScript Completions | 14 |
Python Completions | 1284 |
C# Completions | 285 |
C Completions | 195 |
TypeScript Completions | 126 |
COBOL Completions | 5 |
Total Stars | 75 |
% of votes with a positive feedback rating | 87% of 567 |
Total "Very Satisfied" Votes | 451 |
Total "Somewhat Satisfied" Votes | 87 |
Total "Not Satisfied" Votes | 29 |