# @param {Integer} n
# @return {Integer[]}
def lexical_order(n)
res = Array.new
curr = 1
n.times {
res << curr
curr *= 10
while curr > n
curr /= 10
curr += 1
curr /= 10 while curr % 10 == 0
end
}
return res
end
wl0ckk Goto Github PK
Name: Uladzimir Kandraciuk
Type: User
Company: BSUIR
Location: $HOME