RAINBOWB - Editorial

qstn:-CodeChef: Practical coding for everyone

soltn:-CodeChef: Practical coding for everyone

I have seen the tutorial also and my solution is also same as described in tutorial bt i am getting WA may be because of modular problem.if that is the case plz explain how to overcome that hurdle and if not please point the mistake…

Thank you for help