Dear Ali,
In the previous question, question 5, the initial network is modified such that "all other routers in AS V redistribute external BGP routes into OSPF with distance at the point of redistribution equal to 21"
This is is also the case in question 6, that's why redistribution in AS V is allowed and so you can obtain such solution.
Hope this answer your question.
Best regards,
Stéphan.