The alphabet for all of the following problems is the same: A, B, C, and null. But I can use an additional character D if I want for this problem.
The initial tape is (A+B+C)*
The initial stack is empty
The final tape is empty
The final stack contains only the character that is most commonly found on the initial tape
I'm trying to think of an algorithm to solve this problem, but I'm not coming up with anything.
I would do it this way. Start searching for your $A$'s. For each $A$ you find, push it onto the stack. Now begin searching for $B$'s. As you find $B$'s, pop an $A$ off the stack for each $B$ you find. If the stack is empty and you find zero or more $B$'s on the tape, move the tape head to the left and start pushing $B$'s onto the stack.
If you find no more $B$'s and have only $A$'s left on the stack, empty the stack and push $A$'s onto the stack again. No repeat what you did with the $B$'s with the $C$'s.
After you finish, empty the tape.