You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a string A denoting a stream of lowercase alphabets. You have to make new string B.
B is formed such that we have to find first non-repeating character each time a character is inserted to the stream and append it at the end to B. If no non-repeating character is found then append '#' at the end of B
INPUT : "abadbc"
OUTPUT: "aabbdd"
**/
public class Solution {
public String solve(String A) {
int[] frequency = new int[26];
Queue<Character> queue = new LinkedList<Character>();