Company: Cognizant_15_dec
Difficulty: medium
Color Sandwich Description Sam is a cook, and he has colored breads and stuffing with which he had made some sandwiches. A sandwich can be made by keeping multiple or no stuffing between two same-colored breads like: qabcq (where abc represents stuffing and q represents coloured bread). The sandwiches are placed one over the other represented by a string S where each character depicts either bread or the stuffing. Your task is to find and return a string value representing the colour of the breads used in all sandwiches. Input Specification input1: A string S representing the sandwiches. Output Specification Return a string value representing the colour of the breads used in all sandwiches. Example 1 Input: qczcquu Output: qu Explanation: Here, the given order of sandwiches is "qczcquu" and the color of the breads in the sandwiches are: The first sandwich is qczcq : where bread is q , and the stuffing is czc . The second sandwich is uu : where bread is u and there is no stuffing. The b