SPOJ CODEM5 - Problem5 , DP

Hi,
I am trying to solve CODEM5 - Problem5, it is a tutorial problem. I am getting SIGSEGV . Please Help

My Solution to problem –

Problem Link –

Check the while loop condition

col>0 && row>=0

when row = 0

if( subset[row-1][col]==true && row>0)         
         row--;

subset[row-1] = subset[-1]

1 Like