Question: Your challenge is to take an array of strings and output the longest string in the array. So for

```
["tiny", "small", "bigger", "biggest"]

```

the output would be `biggest`.

If two elements of the array have the same length, you should choose the one that appears first in the array. That means if the array looks like this:

```
["one", "two", "no"]

```

the output is `one`, but if the array looked like this:

```
["two", "one", "no"]

```

the output is `two`.

---

As this is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), the shortest code in bytes wins.

Answer: 
[dc](https://www.gnu.org/software/bc/manual/dc-1.05/html_mono/dc.html), 39 38 36 bytes
======================================================================================

```
0sl[slssdd]sG[dZdll!>Gooz0<M]dsMxlsp

```

[Try it online!](https://tio.run/##Hcm7DkBAEEbhZ/EG9EJHFNugMpmGcdlkYsW/Qrz8uhQnX3FkCHmIoQQFRBglSSeqUVY6d8epYYG5FFsI5BcLpi9168zUH56pqOqmfUl@Tqv6jpFpsjs8Pw "dc – Try It Online")

Edit: -1 byte, filling up empty space by 'd' instead

Edit: -2 bytes, thanks [@brhfl](https://codegolf.stackexchange.com/users/58230/brhfl) for suggestion!
[Lua](https://www.lua.org), ~~70~~ 64 bytes
===========================================

```lua
function f(a,...)x=...and f(...)return x and#x>#a and x or a end

```

[Try it online!](https://tio.run/##PYlBDoAgDAS/0uAFEsMP9C9ViyHBampJ8PUIHrxsZmZTxlpD5lXjyRAsjt57V6a2yFsLXYU0C0OBloYyD9ih6SmAQLzVSyKrDdZo5MeMYO4DU@qwxH0n@enW78WDErFxrr4 "Lua – Try It Online")

`x` is set to the second argument if that is falsy, otherwise the longest of the second argument and up. The function returns `x` if it is truthy and longer than the first argument, else the first argument.

No type-checking, so works not only for a sequence of strings, but for sequences containing tables, or anything with a `__len` metamethod that returns a number. For instance `f("tiny", {1, 2, 3, 4, 5}, debug.setmetatable(6, { __len = function (self) return self end }))` returns `6`.

This technically breaks the rule of operating on an array (in Lua, a table) because it operates on an argument list, but operating on a table seemed more complicated (`table.sort` is not stable). A table can be unpacked into the function: `f(table.unpack { 'oh', 'one', 'two' })`.