Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding
Ninjas X Naukri.com

Problem of the day

You have been given an integer 'NUM' (32 bits) and an array of size 'N'.

Your task is to flip all the bits of 'NUM' at position 'ARR[i]' where 0<= i <= N-1.

Detailed explanation

```
1 <= 'T' <= 10
1 <= 'NUM' <= 10^9
1 <= 'N' <= 10^5
1 <= 'ARR[i]' <= 31
Time Limit: 1 sec
```

```
2
21
3
4 2 1
40
1
4
```

```
30
32
```

```
Before flipping
21 => 10101
After flipping the 4th, 2nd and 1st bit from the end we get
30 => 11110
Before flipping
40 => 101000
After flipping the 4th bit from the end we get
32 => 100000
```

```
1
5
3
6 2 5
```

```
55
```