Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Anna's homework drill
- function main(X::Array{Int64, 1}, n::Int64 = length(X))
- n3 = div(n, 3)
- for i = 1:n
- c = sum(X .== X[i])
- if c >= n3; return X[i]; end
- end
- return NaN
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement