Eating fish, growing in size You are fish in a pond that needs to survive by eating other fish. You can only eat fish that are the same size or smaller than yourself. You must create a program that takes a shoal of fish as sorted input. From this you must work out how many fish you can eat and ultimately the size you will grow to.

Size chart

+--------------+--------------+--------------+--------------+
|              | Amount extra | Total size 1 | Increase to  |
| Current size |  needed for  |     fish     |    size      |
|              |  next size   |              |              |
+--------------+--------------+--------------+--------------+
|      1       |      4       |      4       |      2       |
+--------------+--------------+--------------+--------------+
|      2       |      8       |      12      |      3       |
+--------------+--------------+--------------+--------------+
|      3       |      12      |      24      |      4       |
+--------------+--------------+--------------+--------------+
|      4       |      16      |      40      |      5       |
+--------------+--------------+--------------+--------------+
|      5       |      20      |      60      |      6       |
+--------------+--------------+--------------+--------------+
|      6       |      24      |      84      |      7       |
+--------------+--------------+--------------+--------------+


Rules


Your size starts at 1
The shoal input will contain fish integers between 0-9
0 = algae and wont help you feed.
The fish integer represents the size of the fish (1-9).
You can only eat fish the same size or less than yourself.
You can eat the fish in any order you choose to maximize your size.
You can only eat each fish once.
The bigger fish you eat, the faster you grow. A size 2 fish equals two size 1 fish, size 3 fish equals three size 1 fish, and so on.
Your size increments by one each time you reach the amounts below.


Returns an integer of the maximum size you could be

Examples

"11112222" =&gt; 3  
4 fish size 1 increases to 2, 4 size 2 makes you 3

"111111111111" =&gt; 3
4 fish size 1 increases to 2, 8 size 1 makes you 3


The shortest code (counting in bytes) to do so in any language in which numbers wins.
JavaScript (ES6), 44 bytes
Takes input as an array of integers.

a=&gt;a.map(x=&gt;s+=(t+=s&gt;=x&amp;&amp;x)&gt;s*-~s*2,t=s=1)|s

Try it online!
How?
The threshold \$T_s\$ to reach the size \$s+1\$ is given by:
$$T_s=2s(s+1)$$
We keep track of our current size in \$s\$ and of what we've eaten so far in \$t\$ (we start with \$t=1\$, so this is actually off by \$1\$).
For each fish \$x\$ in the shoal, assuming it's sorted from smallest to biggest:

we add \$x\$ to \$t\$ (i.e. we eat the fish) whenever we have \$s\ge x\$
we increment \$s\$ (i.e. we grow in size) if \$t &gt; T_s\$