Book ID question

My sister was asking me about this yesterday - we both remember reading this book when we were children, in the late 80s, maybe early 90s. Something happens to make all adults disappear - disease? It takes the kids as they hit puberty, too. They take over a school to live in, all together, and they might all die at the end. It was a very bleak story. The main character may have been a girl?

Could y’all help me figure out which book it was?

Sounds like the Star Trek episode “Miri.”

Sounds a bit like “The Girl Who Owned A City” (The Girl Who Owned a City - Wikipedia) except for the ending.

This is what I thought of, too. I can’t find anything saying it’s based on a book or short story, though.