Kotlin is a popular programming language that offers a wide range of features for developers to write concise and…