0

PROBLEM OF THE DAY : 05/03/2024 | Maximum Index

 6 months ago
source link: https://www.geeksforgeeks.org/videos/problem-of-the-day-05032024-maximum-index/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

PROBLEM OF THE DAY : 05/03/2024

March 06, 2024 |1.4K Views
PROBLEM OF THE DAY : 05/03/2024 | Maximum Index
Problem of the Day, Array, Data Structures and Algorithms
 Save  Share  1 Like
Description
Discussion

Welcome to the daily solving of our PROBLEM OF THE DAY with Yash Dwivedi. We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Array but also build up problem-solving skills.

In this problem, we are given an array a of n positive integers. The task is to find the maximum of j - i subjected to the constraint of a[i] < a[j] and i < j.

Example :

Input:
n = 2
a[] = {1, 10}
Output:
1

Explanation:
a[0] < a[1] so (j-i) is 1-0 = 1.

Give the problem a try before going through the video. All the best!!!
Problem Link: https://www.geeksforgeeks.org/problems/maximum-index-1587115620/1
Solution IDE Link: https://ide.geeksforgeeks.org/online-cpp14-compiler/57b944f8-920a-47d9-a0fb-73401ed324a1

Read More

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK