NCR Voyix checkout and transaction text may contain repeated marker characters such as |, :, or /. Implement get_second_last_index_of(s, ch) to return the zero-based index of the second-last occurrence of ch in s.
The method must scan the string once from left to right, use O(1) additional space, and must not use built-in operations that directly locate or count occurrences, such as count, rfind, rindex, find, slicing with reversal, or regular expressions. If ch occurs fewer than two times, return -1.
s: a Python string, possibly empty.ch: a string containing exactly one character.ch, or -1 when fewer than two occurrences exist.def get_second_last_index_of(s, ch):