Painter problem


sample case is giving correct ans
but test cases are not passing

I have edited your code… You havent taken the mod value… Try to submit now…