# Having problem to understand the problem (lights Out - Codeforces)

**URL:** <https://forum.freecodecamp.org/t/having-problem-to-understand-the-problem-lights-out-codeforces/455094>\
**Category:** General\
**Created:** [April 9, 2021, 7:40am UTC](https://forum.freecodecamp.org/t/having-problem-to-understand-the-problem-lights-out-codeforces/455094 "2021-04-09T07:40:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Plabon\_Kumer\_Sarker](https://avatars.discourse-cdn.com/v4/letter/p/8c91f0/32.png) [@Plabon\_Kumer\_Sarker](https://forum.freecodecamp.org/u/Plabon_Kumer_Sarker)\
**Post date:** [April 9, 2021, 7:40am UTC](https://forum.freecodecamp.org/t/having-problem-to-understand-the-problem-lights-out-codeforces/455094/1 "2021-04-09T07:40:32Z")

</div>

Here is the problem is known as [Lights Out](https://codeforces.com/problemset/problem/275/A).

According to the problem, if I click any place(x) then the up, down, left and the right side will toggle with the corresponding x.( if it’s on then it will off and vice versa )  
[This game](https://daattali.com/shiny/lightsout/) is a better representation of what this problem saying.

But if we look at the first example then it is,  
Input:

```auto
100
000
001

```

And output,

```auto
001
010
100

```

But why the output is like that? I’m expecting,

```auto
010
101
010

```

Please let me know, where I’m making the mistake ❤

---

<div class="post-metadata">

**Author:** ![Sky020](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/sky020/32/128093_2.png) [@Sky020](https://forum.freecodecamp.org/u/Sky020)\
**Post date:** [April 9, 2021, 9:02am UTC](https://forum.freecodecamp.org/t/having-problem-to-understand-the-problem-lights-out-codeforces/455094/2 "2021-04-09T09:02:32Z")

</div>

I was also confused by the problem. So, I looked at someone’s submission, and saw the extra test ouputs, and think I understand it:

- All the lights ~~start off as on~~ (silly sentence) start as being in the ON state:

```auto
111
111
111

```

- You are given an input indicating the number of times a certain switch has been toggled:

```auto
100
000
001

```

- Adjacent (this apparently includes diagonal) lights are affected by toggles

```auto
111 => 001
111 => 010
111 => 100

```

I hope this helps somewhat

---

<div class="post-metadata">

**Author:** ![Plabon\_Kumer\_Sarker](https://avatars.discourse-cdn.com/v4/letter/p/8c91f0/32.png) [@Plabon\_Kumer\_Sarker](https://forum.freecodecamp.org/u/Plabon_Kumer_Sarker)\
**Post date:** [April 9, 2021, 10:09am UTC](https://forum.freecodecamp.org/t/having-problem-to-understand-the-problem-lights-out-codeforces/455094/3 "2021-04-09T10:09:39Z")

</div>

@Sky020 Thank you so much! ❤ It does make sense now.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [October 8, 2021, 10:09pm UTC](https://forum.freecodecamp.org/t/having-problem-to-understand-the-problem-lights-out-codeforces/455094/4 "2021-10-08T22:09:58Z")

</div>

Closed on October 8, 2021, 10:09pm UTC

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
