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: 
[K (oK)](https://github.com/JohnEarnest/ok), 9 bytes
====================================================

```
*x@>#:'x:

```

[Try it online!](https://tio.run/##y9bNz/7/X6vCwU7ZSr3CSkMpIzUnJ1/JWqkkI7UoFUgn56eAqPT8nLTUomIgqzw1Jzk/FyRWAlKXWwkkEvOKy1OLlDT//wcA "K (oK) – Try It Online")

**Example:**

```
*x@>#:'x:("edur";"oot";"taht")
"edur"

```

**Explanation**

```
*x@>#:'x: / solution
       x: / store input in variable x
    #:'   / count (#:) each (')
   >      / sort descending
 x@       / apply indices to x
*         / take the first one

```

**Notes:**

Undeleted as this is classed as non-trivial, despite being basically 5 steps (would be if written as the function `{*x@>#:'x}`).
APL+WIN, 11 bytes
=================

```
s[↑⍒∊⍴¨s←⎕]

```

Prompts for screen input in the form 'abc' 'defg' hijklm'