7 kyu
Inertial Array
287 of 642aweleshetu
Description:
An array is defined to be inertial
if the following conditions hold:
a. it contains at least one odd value
b. the maximum value in the array is even
c. every odd value is greater than every even value that is not the maximum value.
eg:-
So [11, 4, 20, 9, 2, 8] is inertial because
a. it contains at least one odd value [11,9]
b. the maximum value in the array is 20 which is even
c. the two odd values (11 and 9) are greater than all the even values that are not equal to 20 (the maximum), i.e., [4, 2, 8]
Write a function called is_inertial
that accepts an integer array and returns true
if the array is inertial; otherwise it returns false
.
Arrays
Fundamentals
Similar Kata:
Stats:
Created | Aug 26, 2017 |
Published | Aug 26, 2017 |
Warriors Trained | 1054 |
Total Skips | 20 |
Total Code Submissions | 6297 |
Total Times Completed | 642 |
JavaScript Completions | 300 |
C# Completions | 85 |
Python Completions | 287 |
Total Stars | 18 |
% of votes with a positive feedback rating | 88% of 213 |
Total "Very Satisfied" Votes | 169 |
Total "Somewhat Satisfied" Votes | 36 |
Total "Not Satisfied" Votes | 8 |
Total Rank Assessments | 20 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 7 kyu |