Purpose of this repository to keep my LeetCode problem solutions in a single place to use as a reminder and to share with other devs.
There is a section called Resources
where you can find useful information to solve problems in an efficient way.
Test were written based on LeetCode test cases and can be found under src/test/kotlin/XTest.kt
where X
represents
the problem name.
Solutions implements Executable interface which is not related to LeetCode solutions. Purpose of this interface to ensure consistency between problems
class ProblemName : Executable<ProblemArgs, ProblemReturnType> {
override operator fun invoke(args: ProblemArgs): ProblemReturnType {
...
}
data class ProblemArgs(...)
}
// To call
val problemNameInstance = ProblemName()
val args: ProblemArgs = ProblemArgs(...)
val result: ProblemReturnType = problemNameInstance(args)