[Machine] The Messenger of Allah ﷺ prayed seventeen rak'ahs while at Ta'if. The scholar said it is possible to combine the narration of the one who narrated nineteen rak'ahs with the narration of the one who narrated seventeen rak'ahs, and the narration of the one who narrated eighteen rak'ahs. Whoever narrates nineteen rak'ahs should count them as part of the day of arrival and the day of departure, and whoever narrates eighteen rak'ahs, no one should count them as part of both days. And Allah knows best.
أَنَّ رَسُولَ اللهِ ﷺ أَقَامَ سَبْعَ عَشْرَةَ يُصَلِّي رَكْعَتَيْنِ مُحَاصِرًا الطَّائِفَ قَالَ الشَّيْخُ وَيُمْكِنُ الْجَمْعُ بَيْنَ رِوَايَةِ مَنْ رَوَى تِسْعَ عَشْرَةَ وَرِوَايَةِ مَنْ رَوَى سَبْعَ عَشْرَةَ وَرِوَايَةِ مَنْ رَوَى ثَمَانِ عَشْرَةَ بِأَنَّ مَنْ رَوَاهَا تِسْعَ عَشْرَةَ عَدَّ يَوْمَ الدُّخُولِ وَيَوْمَ الْخُرُوجِ وَمَنْ رَوَى ثَمَانِ عَشْرَةَ لَمْ يَعُدَّ أَحَدَ الْيَوْمَيْنِ وَمَنْ قَالَ سَبْعَ عَشْرَةَ لَمْ يَعُدَّهُمَا وَاللهُ أَعْلَمُ