Get best answers to any doubt/query/question related to programming , jobs, gate, internships and tech-companies. Feel free to ask a question and you will receive the best advice/suggestion related to anything you ask about software-engineering , development and programming problems .

0 like 0 dislike
1,183 views
in Online Assessments by Expert (44,360 points)

1 Answer

0 like 0 dislike
  1. image

 

Test cases -

 

  • Input - N=3 Instance=1 array=[5,10,75] Output - 2 (Instance value updated to 2)
  • Input - N=13 Instance=4 array=[10,20,12,1,56,5,67,89,34,7,11,72,50] Output - 2 (After 2nd operation Instance will be 1 and system stops for 10 secs. Next position will be 12 (indexing -1) where Instance becomes 2)
    Constraints - N<=10000, Instances<=100000 and array[i]<=100000
by Expert (44,360 points)
...