code is showing segmentation error when solving for 1e9 otherwise compiling.
Not able to solve for 1e9
hi @akshatkaush use a hash-map to maintain the dp states to optimise the memory. We dont actually need ALL of the 1e9 states, so using a dp array in this case will be inefficient
1 Like