> For the complete documentation index, see [llms.txt](https://timmybeeflin.gitbook.io/cracking-leetcode/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://timmybeeflin.gitbook.io/cracking-leetcode/two-pointer/tips.md).

# Tips

two porinters pattern

complex solution will like this:

```
while (l < r) { // global while
    while (l < r && xxx ) {
        //in internal while loop, keep check and skip some elements
    }
    l++;
    r--;
}
```

&#x20;
