Organize these code fragments in an order that successfully completes the task according to the given parameters.
Objective: Your task is to write Kotlin code to extract files from a ZIP archive.
Task Description:
Import the necessary modules for handling files and ZIP archives.
Open a ZIP file named "example.zip".
Apply a functional approach for managing resources, automatically closing them after use.
Go through all the entries in the ZIP archive.
Create an input stream for each entry.
Generate an output stream to write data to a file named after the current archive entry.
Transfer the data from the input stream to the output stream.