Test case:

arrangedProbability(1000000000) should return 3822685023.

It says that the answer is 3822685023, but isn’t blues-710477454; total-1004766851 the answer too?

What I understand is that I should find the amount of blues where the probability is 0.5 and the total amount is closest to the limit.

```
>
> function arrangedProbability(limit) {
> let isValid = false;
>
> let total = limit;
>
> let discriminantRoot = 0;
>
> while(!isValid){
// To avoid multiplication, I moved the total outside the parentheses.
// And then multiply it on squareRoot total;
> discriminantRoot = (1/total)+ 2*(total - 1);
> discriminantRoot = Math.pow(discriminantRoot,0.5)* Math.pow(total,0.5);
>
> if(discriminantRoot === Math.floor(discriminantRoot) && discriminantRoot % 2 === 1){
> isValid = true;
> }else{
> total++;
> }
> }
> let answer = 1 + discriminantRoot;
> answer /=2;
> console.log(total,answer);
> return answer;
> }
>
>
> arrangedProbability(1000000000000);
```