# How to use a 'two pointer' algorithm in Elixir

**URL:** <https://forum.elixirforum.com/t/how-to-use-a-two-pointer-algorithm-in-elixir/42513>\
**Category:** Questions\
**Tags:** functional-programming, algorithm, arrays\
**Created:** [September 21, 2021, 7:20am UTC](https://forum.elixirforum.com/t/how-to-use-a-two-pointer-algorithm-in-elixir/42513 "2021-09-21T07:20:19Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![stackcats](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/stackcats/32/24340_2.png) [@stackcats](https://forum.elixirforum.com/u/stackcats)\
**Post date:** [September 22, 2021, 2:21pm UTC](https://forum.elixirforum.com/t/how-to-use-a-two-pointer-algorithm-in-elixir/42513/3 "2021-09-22T14:21:59Z")

</div>

Thanks for your reply.

I got AC after switch nums to Map.

Should I always use Map to simulate random access to an Array?

---

_[View the full topic](https://forum.elixirforum.com/t/how-to-use-a-two-pointer-algorithm-in-elixir/42513)._
