I took a computer science test today and finished it by using lists, and it worked fine. We didn't actually learn lists yet, but I sort of understood how they worked, so I used them anyway. My cs teacher just came into my breakout room and asked me the functions of the code, and I explained it, and for some reason he thinks I cheated?? What? I showed him my history and there wasn't anything suspicious about it. I just figured out the answer within 10 minutes which was apparently really fast. I quite literally explained each function of each individual word, and he just said "I'll think about it." I have a meeting with admin and parents real soon, and I don't know what to say, because I didn't use any outside sources. I already explained the functions of my code, and even though I may have been a bit suspicious since I used code we haven't learned yet, he never said we couldn't, and even said it was fine when he entered my breakout room. He also doesn't have any proof that I cheated off of anyone, so I'm pretty sure I'm fine, but I'm still really worried. What am I supposed to do?
You seem to have done exactly the right thing, explaining your work. Just keep insisting that you didn't cheat. It isn't your job to prove your innocence.
And no, there is nothing wrong about learning things other than what has appeared already in lectures.
I'll guess that the professor had an idea about what answers "should be" based on the current point in the course and didn't anticipate using tools not yet introduced. But unless there are clear instructions to the contrary, there is nothing wrong with using what you know.
If you are really accused, then next steps might be to see a student support office or escalate to the department head. But hopefully it won't come to that.