Surah Al-Kahf 18:91
كَذَٰلِكَ وَقَدْ أَحَطْنَا بِمَا لَدَيْهِ خُبْرًا
Thus. And We had encompassed [all] that he had in knowledge.
Translation: Saheeh International
Tafsir
So it was in other words the situation was as We have stated; and We encompassed whatever pertained to him that is what Dhū’l-Qarnayn possessed in the way of machinery men and otherwise in knowledge.
Excerpt from Tafsir al-Jalalayn, commentary on 18:91, via Quran.com. The reader has the full commentary and 9 more tafsirs.