# Help me in solving AOCV206 problem

### My issue

What exactly does rightmost index mean here?

### Problem Statement

Given an array A of length N, please perform the following operations:

Find the largest element of the array A - store it as the variable large
Find the right-most index of the largest element of the array - store it as the variable right
Output the largest element and the right-most index of the largest element of the array.

``````Learning course: [C++ for problem solving - 2](https://www.codechef.com/learn/cpp-beginner-v2-p2)
Problem Link: https://www.codechef.com/learn/BP00BC18_V2/problems/AOCV206``````

// Update the ‘_’ in the code below to solve the problem

include <bits/stdc++.h>
using namespace std;

int main()
{
int t;
cin >> t;

``````while(t--)
{
int N;
cin >> N;
int A[N];
for(int i=0; i < N; i++)
{
cin >> A[i];
}
// Initialise the rightmost index to 0
int right = 0;
// Initilise the largest value to -100. The smallest element in A is -100
int large = -100;
for(int i=0; i < N; i++)
{
// Here - we need to check if A[i] '=' large so that we can update the variable 'right'
if (A[i] >=large)
{
large = A[i];
right = i;
}
}
cout << large << " "<< right << endl;

}
``````

}