Add Support for Scala 3
1406

UDATE: As of June 2024, Scala 3 is supported in Leetcode.

Scala 3.0.0 was released in 2021 and Scala 3.3.0 LTS was released in 2023. They added many new features to make it easy for beginners to use the languege, but also many features for advanced users.

As an example, here is the Hello World program in Scala 3:

@main
def hello = 
  println("Hello, world!")

Compare it with the boilerplate code needed for the same program in Scala 2.x

object Hello {
    def main(args: Array[String]) = {
        println("Hello, world!")
    }
}

Because Scala 3 is backwards compatible with Scala 2.x, the existing problems need no change to support Scala 3.

[Originally posted in June 2021, last updated Oct 2023]

Comments (31)