A teenager who escaped from the burning Grenfell Tower hours before her chemistry GCSE achieved a "fantastic" A grade in the paper.