Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Erlang list question

I have a list with tuples in Erlang for example:

[{1, "AAA"}, {2, "AAA"}, {3, "AAAAAAAA"}]

How can i get tuple from this list with max first element from this tuples?

Thank you.

like image 629
0xAX Avatar asked Apr 02 '26 01:04

0xAX


1 Answers

In this case lists:max/1 will return what you want. For this to work all tuples must have the same number of elements.

like image 175
Arjan Avatar answered Apr 03 '26 16:04

Arjan