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...
Amazon Software Development Engineer Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
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

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter