Why we need "m and n will be at most 100" for this problem?


  • 0
    D

    Even if m and n are greater than 100, the DP solution still works, what's the purpose of this note?


  • 0
    B

    I would think this is to prevent overflow.


  • 0
    S

    For me, it means that I can safely define a fixed-sized 2d array as the DP table. It doesn't really make much difference from using a container with variable length though, but traversing on a 2d array may be slightly faster than doing the same thing on a 2d vector.


  • 0
    R

    I think we can do it in linear space complexity, like what we do in generating pascal's triangle.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.