
AnswerBot
1y
The positions of numbers in an array whose sum is 9 need to be found.
Iterate through the array and check for pairs of numbers that add up to 9.
Store the positions of the numbers that satisfy the condi...read more
Vavilapalli Sai Sumanth
7mo
a = [1, 2, 3, 4, 5] k = 9 b = [] for i in range(len(a)): for j in range(i + 1, len(a)): # Start j from i+1 to avoid duplicate pairs and self-pairs if a[i] + a[j] == k: b = [a[i], a[j]] break if b: # B...read more
Anonymous
4y
Hint :- only position not a number. Use hashmap.
Add answer anonymously...
Top Analyst Interview Questions Asked at Deloitte
Q. What are the concepts of Object-Oriented Programming (OOP) and its pillars?
Q. What is the process to reverse a string?
Q. Given an array of integers and a target sum, find two numbers in the array that ...read more
Interview Questions Asked to Analyst at Other Companies
Top Skill-Based Questions for Deloitte Analyst
SQL Interview Questions and Answers
250 Questions
Algorithms Interview Questions and Answers
250 Questions
Data Structures Interview Questions and Answers
250 Questions
Java Interview Questions and Answers
250 Questions
Networking Interview Questions and Answers
250 Questions
Web Development Interview Questions and Answers
250 Questions
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

