DEV Community

loading...

Discussion on: Daily Challenge #281 - Area or Perimeter

Collapse
alxgrk profile image
Alexander Girke

In Kotlin it would be:

fun area_or_perimeter(a: Int, b: Int) =
        if (a == b)
            a * b
        else
            2 * (a + b)