Please help me to solve these two problem
plz help me to solve ths 2 question-
Q1:- Write a program which takes a string as input and give the position of all matching brackets as output.
E.g. input is â{{}{{}{}}{}}â
And output should be:
Bracket on position 2 matches with brackets on position 3
Bracket on position 5 matches with brackets on position 6
Bracket on position 7 matches with brackets on position 8
Bracket on position 10 matches with brackets on position 11
Q2:- A string can accept only a-z (all alphabets without repetition).Now a string is say, âREPEATABLEâ. Now whenever it contains a repeated alphabet(E ,A in this case)then the second repeated letter should be deleted as well as the letter after it also should be deleted from the string. So the output will be âREPTABLâ. Write a programme to give the output.
|