How to solve this Range Error in my code? How to solve this Range Error in my code? dart dart

How to solve this Range Error in my code?


There is an error when you start from the highest index:

 for(int i = alfa.length-1

Your index has to go down and you are using ++.

Use this:for(int i = alfa.length-1; i > -1; i--)