aboutsummaryrefslogtreecommitdiff
path: root/challenge-332/hvukman/lua/332_p2.lua
blob: 110967025232801456c172aa80188d90b4395f1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function Oddletters(inp)
    local odd = true
    for c in inp:gmatch"." do
      --  print(c)
        local i = 0

        for _ in string.gmatch(inp,c) do
            i = i+1
        end
        

        if i%2==0 then
            print("false")
            odd =false
        end
        if i%2 == 0 then break end

    end
    if odd==true then
        print("true")
    end
end

Oddletters("weelky")
Oddletters("perl")
Oddletters("challenge")