Quantcast
Channel: First steps - JuliaLang
Viewing all articles
Browse latest Browse all 2795

Compile error

$
0
0

hi all
can any one tell me why this code not working ?
its from

function checkMagazine(magazine, note)
d = Dict{String,Int}()
out = ""

    for i in magazine
        if i in d
            d[i] +=1
        else
            d[i] -=1
        end
    end

    for i in note
        if i not in d
            print("NO")
            break
        end

        if d[i] ==0
            delete!(d[i])
        end

        d[i] -=1
    end
println("YES")
end

3 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 2795