Hi i need some help in creating this program,
Program, in a standard programming language (e.g. Java), a fast and simple solution to the following problem without using any regular expression or pattern matching utilities. Given a non-finite stream of characters, output an "A" if the characters "xxx" are found in exactly that sequence. If the characters "xMx" are found instead, output a "B". Do not re-process characters so as to output both an “A” and a “B” when processing the same input. For example:
1. The following input xxMxMxxxMxxx would produce the following output: BAA
2. The following input xxxMxMxxxxMMxMxMx would produce the following output: ABAB
thanks in advance.