وَلَمَّا بَلَغَ أَشُدَّهُۥٓ ءَاتَيْنَـٰهُ حُكْمًا وَعِلْمًا ۚ وَكَذَٰلِكَ نَجْزِى ٱلْمُحْسِنِينَ
Wa lammaa balagha ashuddahooo aatainaahu bukmanw wa 'ilmaa; wa kazaa lika najzil muhsineen
Erginlik çağına erince ona hikmet ve bilgi verdik. İyi davrananları böyle mükafatlandırırız.
And when he reached his maturity, we gave him judgment and knowledge. This is how we reward those who do good.
The gift arrives exactly where the story will need it: Yusuf is given judgment and knowledge one verse before the doors are bolted behind him. Hukm is the capacity to decide rightly under pressure, and the commentators divide over whether it means prophethood here or plain discernment. Surah Yusuf keeps setting God's provision just ahead of the trial.