Sir code is showing segmentation fault . can you please check
i have done some modification
- use bool array instead of int as you are storing only 0 and 1
- use ll instead of int
- make global array
you can check now
i have done some modification
you can check now