标签:ring nbsp ++ ever com inf eve int val
def gray(n: Int): List[String] = { def go(x: Int, result: List[String]): List[String] = { if (x <= 0) result else { val cur = result.map(s => ("0" + s)) ++ result.reverse.map(s => ("1" + s)) go(x - 1, cur) } } go(n, List("")) }
标签:ring nbsp ++ ever com inf eve int val
原文地址:https://www.cnblogs.com/wqkant/p/10588570.html