Update:
Approach 1:
Now you can create a kotlin file with empty main() method and then you can run the code directly using run icon on left(of 7th line) in android studio (AS version: 3.5.3 ) editor like

This will internally create the TestKt(name of file) class with PSVM method(and required structure) to execute the code.
Demo configuration(automatically generated) to run this file will look like

Approach 2(with Scratch file, tested on AS 3.6):
- Select the
Projectview in the project navigation panel. - Create a Kotlin scratch file from
New -> Scratch File -> Kotlin

- Now add your code and see the result on the right-side panel

Android studio (intellij) provides REPL(Real Eval Print Loop) tool to write and execute kotlin code.
- Open kotlin REPL as
Tool -> kotlin -> kotlin REPL

- Write your code

- Press command + enter (on mac) to execute your code(pay attention to the key combo on different platform)
Either write code or import the class

Tips:
- Rebuilt the project once you change the source code
- Use arrow key to go back in history