# Code giving wrong answer for Advent of Code 2015 day 6

I was trying to write a solution to Advent of Code 2015 day 6 and I am getting a wring answer.

``````function solve()
path = pwd() * "/AoC/input.txt"

lights = BitArray(zeros(1000,1000))

for i in instructions
if split(i," ")[1] == "turn"
start_x,start_y = map(x -> parse(Int64,x),split(split(i," ")[3],','))
end_x,end_y = map(x -> parse(Int64,x),split(split(i," ")[5],','))
start_x += 1
start_y += 1
end_y += 1
end_x += 1

if split(i," ")[2] == "on"

lights[start_x:start_y,end_x:end_y] .= 1

elseif split(i," ")[2] == "off"

lights[start_x:start_y,end_x:end_y] .= 0

end
elseif split(i," ")[1] == "toggle"

start_x,start_y = map(x -> parse(Int64,x),split(split(i," ")[2],','))
end_x,end_y = map(x -> parse(Int64,x),split(split(i," ")[4],','))
start_x += 1
start_y += 1
end_y += 1
end_x += 1
lights[start_x:start_y,end_x:end_y] = .!lights[start_x:start_y,end_x:end_y]

end
end

return sum(lights)

end

println(solve())
``````

Also, I would like to know if there is better way to achieve the same task in more â€śjulia-wayâ€ť .