you have a sorted array in increasing order.Now shift n elements from right to first. Write a code to efficiently find n(no. of elements shifted). For example: initial array : 1,2,3,7,7,7,8 after shift array : 7,7,8,1,2,3,7 output :3
AnswerBot
1y
Find the number of elements shifted in a sorted array after shifting n elements from right to first.
Find the index of the minimum element in the shifted array
The number of elements shifted is equal to...read more
mamatha
10mo
works at
Elements number 3.
Help your peers!
Add answer anonymously...
Top Amazon Software Development Engineer interview questions & answers
Popular interview questions of Software Development Engineer
Top HR questions asked in Amazon Software Development Engineer
Stay ahead in your career. Get AmbitionBox app
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+
Reviews
4 L+
Interviews
4 Cr+
Salaries
1 Cr+
Users/Month
Contribute to help millions
Get AmbitionBox app