String division using operator overloading in Kotlin, please help me to complete this code. No change can be made in main function.
Find common from both string like a=aabcc b=abdec answer=abc (unique common characters)
fun main(args: Array<String>)
{
val a:String = readLine()!!
val b:String = readLine()!!
val result = a/b
println(result)
}
Operators can be defined externaly, just like extension functions:
operator fun String.div(other: String): String {
// Put your implementation here
}
As for the implementation: you should probably do your assignment yourself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With