It finds all top level windows that match the filter (in the example - explorer windows), then iterates over those that do not match the title you want to keep, highlighs and closes the window.
Be careful with CloseApplication with that setup, as it will close the whole application that it will find - that means completely closing explorer in the attached example (which is generally not what you want), hence the CloseWindow was used.
Do note that the .ToArray in the ForEach source is needed to get rid of the IEnumerable context error:
Main has thrown an exception
Source: For each
Message: An ActivityContext can only be accessed within the scope of the function it was passed into.
Object name: 'System.Activities.CodeActivityContext'.
Exception Type: ObjectDisposedException
System.ObjectDisposedException: An ActivityContext can only be accessed within the scope of the function it was passed into.