phData pipeline validation uses compact marker strings containing uppercase A, uppercase B, and optional separator characters such as -, _, or spaces. Return True if every A occurs before every B in the string. Characters other than A and B do not affect the ordering.
Once a B has been observed, encountering an A makes the string invalid. The function should process the input in one left-to-right pass and may stop as soon as the ordering is violated.
Implement ordered_markers(s), where s is a string. Return a Boolean:
True if no A appears after any B.False otherwise.An empty string or a string containing only separators, only A characters, or only B characters is valid.
def ordered_markers(s):