Problem:
Score : 100 points

Problem Statement

Given is a three-digit integer N. Does N contain the digit 7?

If so, print Yes; otherwise, print No.

Constraints

100 \leq N \leq 999

Input

Input is given from Standard Input in the following format:

N

Output

If N contains the digit 7, print Yes; otherwise, print No.

Sample Input 1

117

Sample Output 1

Yes

117 contains 7 as its last digit.

Sample Input 2

123

Sample Output 2

No

123 does not contain the digit 7.

Sample Input 3

777

Sample Output 3

Yes

Solution in Julia (1.4.0) (judge verdict: Runtime Error)

import Base: iterate, length

struct Combination{T}
    arr::Array{T,1}
    picks::Int
end

function length(combi::Combination)
    m = length(combi.arr)
    n = combi.picks
    
    result = 1
    for i in 1:n
        result *= (m - i + 1)
        result = div(result, i)
    end
    result
end

function nextstate(arraysize::Int, state::Array{Int})
    if state[1] == arraysize - length(state) + 1
        return [0]
    end

    if state[end] < arraysize
        state[end] += 1
        return state
    end

    targetindex = length(state) - 1

    while targetindex > 0
        if state[targetindex] + 1 === state[targetindex+1]
            targetindex -= 1
        else
            state[targetindex] += 1
            for i in (targetindex+1):length(state)
                state[i] = state[i-1] + 1
            end
            return state
        end
    end
    # ここに来ることは無いはず
    return state
end

function iterate(combi::Combination, state)
    if state == [0]
        return nothing
    end
    arraysize = length(combi.arr)
    value = combi.arr[state]
    state = nextstate(arraysize, state)
    return (value, state)
end

function iterate(combi::Combination)
    if combi.picks > length(combi.arr)
        return nothing
    end
    if combi.picks === 0
        return (typeof(combi.arr)[], [0])
    end
    state = collect(1:(combi.picks))
    value = combi.arr[state]
    arraysize = length(combi.arr)
    return (value, nextstate(arraysize, state))
end

function main()
    n = parse(Int, readline())
    s = readline()
    array = collect(1:n)
    count = 0
    counts = [Int[], Int[], Int[]] #RGB
    x,y,z = 0,0,0
    for i in 1:n
        c = s[i]
        if c == 'R'
            push!(counts[1], i)
            x += 1
        elseif c == 'G'
            push!(counts[2], i)
            y += 1
        else
            push!(counts[3], i)
            z += 1
        end
    end

    for i in 1:x
        for j in 1:y
            for k in 1:z
                if counts[2][j] - counts[1][i] == counts[3][k] - counts[2][j]
                    #カウントしない
                else
                    count += 1
                end
            end
        end
    end     

    println(count)
end

main()