7 kyu
Magic Index
1,733rickawd
Description:
A magic index in an array A[1...n-1] is defined to be an index such that A[i] = i. Given a sorted array of distinct integers, write a method to find a magic index, if one exists, in array A.
findMagic([-20,-10,2,10,20]); // Returns 2
Dynamic Programming
Recursion
Arrays
Algorithms
Similar Kata:
Stats:
Created | Sep 12, 2016 |
Published | Sep 12, 2016 |
Warriors Trained | 2225 |
Total Skips | 18 |
Total Code Submissions | 4021 |
Total Times Completed | 1733 |
JavaScript Completions | 1733 |
Total Stars | 14 |
% of votes with a positive feedback rating | 86% of 243 |
Total "Very Satisfied" Votes | 188 |
Total "Somewhat Satisfied" Votes | 42 |
Total "Not Satisfied" Votes | 13 |
Total Rank Assessments | 12 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |