I would add to the advice here that you can decide when she is coming out of the room in two ways. Set a timer in a nearby room that she can hear, and tell her that she can come out when it beeps. My son is quiet so he won’t miss the beep. Not all kids do that.
The other way is to nicely tell her that she can come out when she is calm and ready to apologize to those she screamed at or hit. It is important for the other children to feel safe and respected and time away from the one screaming and apologies help.
Hang in there:)