Sorry for the toy example, but that was the best I could come up with due to my limited knowledge on the subject. I am interested in knowing how Kingsford in his paper "Fast search of thousands of short-read sequencing experiments" uses k-mers as a substitution for fx. BLAST. He makes use of Bloom Filters to query a sequence that is divided into k-mers. If the match of k-mers is above a threshold, then we would say that our query has a similarity.
I don't understand how it's possible to use k-mers instead of alignment tools?

If you intend to identify genes then using this toy example is inappropriate. One would need to use much longer k-mers. This paper may help provide some background reference materials. One more tool.
Separate to my answer below, I would contend that the right hand alignment is all that realistic (no matter the method). Unless you were artificially penalising gaps very low (which is the opposite of the biological reality) I'd be very suprised if you would come across 2 offset gaps like that.