7 kyu

Magic Index

1,762rickawd

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:

CreatedSep 12, 2016
PublishedSep 12, 2016
Warriors Trained2258
Total Skips18
Total Code Submissions4088
Total Times Completed1762
JavaScript Completions1762
Total Stars14
% of votes with a positive feedback rating85% of 248
Total "Very Satisfied" Votes191
Total "Somewhat Satisfied" Votes42
Total "Not Satisfied" Votes15
Total Rank Assessments12
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • rickawd Avatar
  • jhoffner Avatar
Ad