Mansoorinho / DrChrono-Challenge

My codes for Dr Chrono Challenge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DrChrono-Challenge by HackerRank

My codes for Dr Chrono Challenge

Rock Collectors Jamie and Ned are rock collectors.

They store their rocks in a box with partitions where each partition contains a specific type of rock.
The partitions are numbered from 0 to n 1 where each partition i contains quantity, the number of rocks.
Both, Jamie and Ned have the box with same partitions.
Jamie's box is arranged in a random order whereas Ned's box is arranged in a sorted order.
Geoffrey joins them and observes that the number of rocks in the th partition of his box is the sum of number of rocks in Jamie's ith partition and number of rocks in Ned's ith partition. Find the most frequently curring quantity in Geoffrey's box and return the highest index of the partition with that quantity.
Note:

  • The partitions are 0 indexed.
  • If two or more quantities have the same frequency, then consider the highest quantity among them
Complete the get rock_index function in the editor below. It has one parameter an array.quantity. of n positive integers.
It must return an integer denoting the highest index of the partition containing the most frequently occurring quantity in Geoffrey's box.

Input Format

Locked stub code in the editor reads the following input from stdin and passes it to the function: The first line contains an integer, n, denoting the number of types of rocks.
Each line i of the n subsequent lines contains integers denoting the number of each type of rock in Jamie's box.

Constraints

  • 1 <= n <= 105
  • 1 <= quantityi <= 106

Output Format

Return an integer denoting the highest index of the partition containing the most frequently occurring quantity in Geoffrey's box.

Sample Output 0

6
5
5
9
19
2
2

Sample Output 0

1

About

My codes for Dr Chrono Challenge


Languages

Language:Python 100.0%