two pointer without counter