Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- object tony {
- println("Welcome to the Scala worksheet") //> Welcome to the Scala worksheet
- def foo[A](l:List[A]):Int = {
- l.zipWithIndex.indexWhere { pair => l.indexOf(pair._1) != pair._2 }
- } //> foo: [A](l: List[A])Int
- foo(List(1, 2, 3, 3, 4)) //> res0: Int = 3
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement