7 kyu
Find the middle element
16,774 of 36,926myTerminal
Description:
As a part of this Kata, you need to create a function that when provided with a triplet, returns the index of the numerical element that lies between the other two elements.
The input to the function will be an array of three distinct numbers (Haskell: a tuple).
For example:
gimme([2, 3, 1]) => 0
2 is the number that fits between 1 and 3 and the index of 2 in the input array is 0.
Another example (just to make sure it is clear):
gimme([5, 10, 14]) => 1
10 is the number that fits between 5 and 14 and the index of 10 in the input array is 1.
Arrays
Fundamentals
Similar Kata:
Stats:
Created | Nov 5, 2014 |
Published | Nov 5, 2014 |
Warriors Trained | 60656 |
Total Skips | 8473 |
Total Code Submissions | 103789 |
Total Times Completed | 36926 |
JavaScript Completions | 16774 |
Python Completions | 14691 |
CoffeeScript Completions | 32 |
Ruby Completions | 1602 |
Haskell Completions | 503 |
C# Completions | 1706 |
Rust Completions | 746 |
C Completions | 536 |
Go Completions | 879 |
COBOL Completions | 12 |
Factor Completions | 16 |
Total Stars | 434 |
% of votes with a positive feedback rating | 93% of 3926 |
Total "Very Satisfied" Votes | 3410 |
Total "Somewhat Satisfied" Votes | 462 |
Total "Not Satisfied" Votes | 54 |
Total Rank Assessments | 365 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 1 kyu |
Lowest Assessed Rank | 8 kyu |