7 kyu
max diff - easy
4,698 of 13,195Tefferson
Description:
You must implement a function that returns the difference between the largest and the smallest value in a given list / array
(lst
) received as the parameter.
lst
contains integers, that means it may contain some negative numbers- if
lst
is empty or contains a single element, return0
lst
is not sorted
[1, 2, 3, 4] // returns 3 because 4 - 1 == 3
[1, 2, 3, -4] // returns 7 because 3 - (-4) == 7
Have fun!
Mathematics
Lists
Arrays
Fundamentals
Similar Kata:
Stats:
Created | Jan 26, 2017 |
Published | Jan 26, 2017 |
Warriors Trained | 15877 |
Total Skips | 404 |
Total Code Submissions | 29843 |
Total Times Completed | 13195 |
JavaScript Completions | 5358 |
Python Completions | 4698 |
C# Completions | 797 |
F# Completions | 86 |
Java Completions | 1992 |
Rust Completions | 370 |
Ruby Completions | 154 |
C Completions | 113 |
COBOL Completions | 4 |
Total Stars | 90 |
% of votes with a positive feedback rating | 92% of 1776 |
Total "Very Satisfied" Votes | 1543 |
Total "Somewhat Satisfied" Votes | 197 |
Total "Not Satisfied" Votes | 36 |
Total Rank Assessments | 28 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |