First Unique Character in a Stream Problem Statement

Given a string A consisting of lowercase English letters, determine the first non-repeating character at each point in the stream of characters.

Example:

Input:
bbaca
Output:
baaac
Explanation:

For the given string 'bbaca':
1. First stream is 'b'; first non-repeating character is 'b'.
2. Next stream is 'bb'; no non-repeating character.
3. Next stream is 'bba'; first non-repeating character is 'a'.
4. Next stream is 'bbac'; first non-repeating character is 'a'.
5. Next stream is 'bbaca'; first non-repeating character is 'c'.

Constraints:

  • 1 <= T <= 100
  • 1 <= N <= 10000
Input:
The first line contains an integer 'T', the number of test cases.
Each of the next 'T' lines contains a string 'A'.
Output:
For each test case, print a string of characters that represent the first non-repeating character at each point in the stream.

Note: You do not need to print anything; it is handled externally.

AnswerBot
4mo

Given a string of lowercase English letters, find the first non-repeating character at each point in the stream.

  • Create a hashmap to store the frequency of each character as it appears in the stream.

  • It...read more

Help your peers!
Select
Add answer anonymously...

Amdocs Software Developer interview questions & answers

A Software Developer was asked 6mo agoQ. What are the key concepts of Object-Oriented Programming (OOP)?
A Software Developer was asked 6mo agoQ. What is the internal working mechanism of a HashMap?
A Software Developer was asked 8mo agoQ. What is SDLC and what are its types?

Popular interview questions of Software Developer

A Software Developer was asked 6mo agoQ1. What are the key concepts of Object-Oriented Programming (OOP)?
A Software Developer was asked 6mo agoQ2. What is the internal working mechanism of a HashMap?
A Software Developer was asked 8mo agoQ3. What is SDLC and what are its types?
Amdocs Software Developer Interview Questions
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
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

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

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits