I solved the problem but i didnt understand the code

Yusuf, please be sure to properly format your code when you post it. You can read how to do so here: [Essentials] How To Post/Format Your Code Correctly

However, to speak to your question. Yes, strongest = 0, but only at the start. The first enemy you encounter will replace the zero with their health value. Now, the next enemy is tested. If it is stronger, then it replaces the prior enemy; but if it is weaker, the code will skip him and move on to the next…and so on. In the end, you end up with the leader, who just happens to be the strongest of all.

1 Like