# \#iteration

**URL:** https://forum.elixirforum.com/tag/iteration/935.md

[Latest](https://forum.elixirforum.com/latest.md) · [Categories](https://forum.elixirforum.com/categories.md) · [Tags](https://forum.elixirforum.com/tags.md)

---

## [How to access the last iterated Item in an iteration](https://forum.elixirforum.com/t/how-to-access-the-last-iterated-item-in-an-iteration/46223)

<div class="topic-metadata">

**Author:** [@peprog](https://forum.elixirforum.com/u/peprog)\
**Replies:** 8\
**Last updated:** [February 26, 2022, 10:03am UTC](https://forum.elixirforum.com/t/how-to-access-the-last-iterated-item-in-an-iteration/46223 "2022-02-26T10:03:29Z")

</div>

Hello, I’m trying to calculate a leaderboard of user just attended in a contest. here is the structure of list I have. it is sorted descending so I’m pretty much sure that the first item has the most point and the next …

---

## [Iterating a list to compare all elements with each other](https://forum.elixirforum.com/t/iterating-a-list-to-compare-all-elements-with-each-other/45388)

<div class="topic-metadata">

**Author:** [@Harrygr](https://forum.elixirforum.com/u/Harrygr)\
**Replies:** 6\
**Last updated:** [January 20, 2022, 9:40pm UTC](https://forum.elixirforum.com/t/iterating-a-list-to-compare-all-elements-with-each-other/45388 "2022-01-20T21:40:51Z")

</div>

In imperative languages, if one wants to compare every element in an array with the other they can use nested loops where the inner loop starts from the iterator of the outer loop. This avoids comparing elements with eac…

---

## [Elixir big comprehension-list optimisation - takes too long](https://forum.elixirforum.com/t/elixir-big-comprehension-list-optimisation-takes-too-long/20908)

<div class="topic-metadata">

**Author:** [@sandeshsoni](https://forum.elixirforum.com/u/sandeshsoni)\
**Replies:** 9\
**Last updated:** [March 21, 2019, 1:01pm UTC](https://forum.elixirforum.com/t/elixir-big-comprehension-list-optimisation-takes-too-long/20908 "2019-03-21T13:01:05Z")

</div>

Need help! need to optimize. My terminal hangs when I run the code. I have a list of 1\_78\_000 words i.e 178k words I need pairs of words, such that when joined together, their length is exactly ten. # this is how I g…

---

## [Update a map that is outside scope of an iterator](https://forum.elixirforum.com/t/update-a-map-that-is-outside-scope-of-an-iterator/16413)

<div class="topic-metadata">

**Author:** [@JupiterIO1](https://forum.elixirforum.com/u/JupiterIO1)\
**Replies:** 2\
**Last updated:** [September 9, 2018, 12:51am UTC](https://forum.elixirforum.com/t/update-a-map-that-is-outside-scope-of-an-iterator/16413 "2018-09-09T00:51:53Z")

</div>

For each key in map\_A (we don’t care about the values) get another known map (for example sake: map\_B ) which is referenced by the key at map\_A (that we are looping) and test whether any of the keys in map\_B matche…

---

## [Suggest me to better idea to Nested Loop](https://forum.elixirforum.com/t/suggest-me-to-better-idea-to-nested-loop/15605)

<div class="topic-metadata">

**Author:** [@krishnaoz](https://forum.elixirforum.com/u/krishnaoz)\
**Replies:** 5\
**Last updated:** [August 4, 2018, 1:31pm UTC](https://forum.elixirforum.com/t/suggest-me-to-better-idea-to-nested-loop/15605 "2018-08-04T13:31:26Z")

</div>

I have data in multidimensional array. And I will not use nested loop. so please give me suggestion, what I can do for print each array data. Below code related to single loop. map = %{} Enum.each \[1, 2, 3\], fn x -\> …
