6sense Interview Question

Find the switch index in a long string