The correct answer is “I didn’t know”, because this is a negative sentence in the past simple tense. We form negative sentences with didn’t + the infinitive form of the verb (know)

“Knew” is the past simple form that we use in affirmative sentences.

Example: I knew the answer (affirmative); I didn’t know the answer (negative).

You can read more about past simple tense and do some exercises here.