My solutions for Hackerhank, Algoexpert and Leetcode ADS questions.
Install kotlin and then run:
kotlin -J-ea -script <path-to-file.kts>
- Install the Code Runner plugin
- Open your user settings.json
- Locate the
code-runner.executorMapByFileExtensionsection - Locate the
.ktsconfiguration and add-J-earight afterkotlinc
Example:
"code-runner.executorMapByFileExtension": {
...
".kts": "kotlinc -J-ea -script",
...In recent versions of Kotlin, it can be even simpler:
"code-runner.executorMapByFileExtension": {
...
".kts": "kotlin -J-ea",
...