Zig zag sequence and strstr