A stream of characters is coming, at any moment you have to tell ‘k’ elements closest to a given number (code)
AnswerBot
1y
The code should find the 'k' elements closest to a given number from a stream of characters.
Use a priority queue to keep track of the 'k' closest elements.
For each character in the stream, calculate i...read more
Help your peers!
Add answer anonymously...
Top Amazon Software Developer interview questions & answers
Popular interview questions of Software Developer
Top HR questions asked in Amazon Software Developer
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