Write code to rearrange an array by multiplying consecutive pairs. For example, given an array A0, A1, A2...A9, the resultant array will be A0*A1, A1*A2, A2*A3, and so on. The final array should be in descending order, using a custom compare function in the sort function.
AnswerBot
1y
Rearrange array in consecutive pair multiplication in descending order.
Create a new array to store the multiplied values
Use a loop to iterate through the original array and multiply consecutive pairs
W...read more
Help your peers!
Add answer anonymously...
Info Edge Software Engineer interview questions & answers
A Software Engineer was asked 2w agoQ. What is the dynamic programming approach to solving the Sudoku puzzle?
A Software Engineer was asked 2w agoQ. What is Dijkstra's algorithm and how is it applied to graph theory?
A Software Engineer was asked 06 Jun 2023Q. Given a linked list, reverse the nodes of a linked list k at a time and return i...read more
Popular interview questions of Software Engineer
A Software Engineer was asked 3w agoQ1. What is the dynamic programming approach to solving the Sudoku puzzle?
A Software Engineer was asked 3w agoQ2. What is Dijkstra's algorithm and how is it applied to graph theory?
A Software Engineer was asked 9mo agoQ3. Given a string, determine if it is a palindrome, considering only alphanumeric c...read more
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