CodeKata

CodeKata LeaderboardLeaderboard

206. Index Difference of Min and Max

Geekoin40
Medium

Problem Statement:
Given a number N and array of N integers, print the difference between the indices of smallest and largest number(if there are multiple occurances, consider the first occurance).

Input Description:
Input Size : |N| <= 1000000

Sample Input:
5
3 5 4 4 7

Sample Output:
4

Accepted 4k
Submissions 5k
Acceptance Rate 83.57%
Topics
array
Company
companies

Code Editor

You need to   or  to run or submit the code