Largest int from concatenated ints: Difference between revisions
m
update for 1.0+
m (adding closing parenthesis missing from iterator in for loop.) |
m (update for 1.0+) |
||
Line 1,151:
=={{header|Julia}}==
Perhaps algorithm 3 is more efficient, but algorithm 2 is decent and very easy to implement in Julia. So this solution uses algorithm 2.
<lang julia>function maxconcat(arr::Vector{<:Integer})
b = sort(
return try parse(Int, b) catch parse(BigInt, b) end
end
|