Last active
December 10, 2015 11:08
-
-
Save kazua/4425146 to your computer and use it in GitHub Desktop.
年の中に同じ数値が現れない年
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //K.A | |
| //年の中に同じ数値が現れない年のリスト | |
| object yeardiff { | |
| def yeardiff(maxyear : Int) : Seq[String] = { | |
| (1 to maxyear).map(_.toString.toList).filter(a => a.distinct.size == a.size).map(_.mkString) | |
| } | |
| def main(args : Array[String]) { | |
| val nowyear = 2013 | |
| yeardiff(nowyear).foreach(println) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment