The sentence is mostly correct, but it should not be broken up into separate lines. Also, there should not be a capital letter after the comma. Here's the corrected version:"Astrid Hofferson knew she could win the spelling bee if she memorized all the words in the official booklet."