Marks :10
: 6 | : 0
We got the news that someone was jumping on the positive integer line holding a bag of gold coins. While jumping, he always dropped a gold coin at each position from the start to the end of his jump. We can visit only an integer place and collect the gold coins at that position.
Find the smallest position with the maximum number of coins.
You are given n start and end points corresponding to each jump, in array st[] are the start points and array end[] are the corresponding end points.
Constraints:
1 <= n <= 100000 1 <= st[i] <= 10^9 1 <= end[i] <= 10^9
First line contains and integer n . This is followed by 2 lines The next line contains n space separated integers corresponding to the start position of the jump. The next line contains n space separated integers corresponding to the end position of the respective jump
Output the smallest position which has the maximum number of coins
4 1 3 2 10 8 4 5 11
3
You need to login to view your submissions.
You need to login to view all submissions.
Result : Executed
Feel something is wrong with the test cases?
Result : Accepted
Test Cases :
But to Run or Submit the Problem, you need to Log In.
Continue to Log InYour challenge has been submitted successfully.
You will get a response soon via WhatsApp or Email.
Do let us know your issue.