1411. Number of Ways to Paint N × 3 Grid

ref:

dp

time: O(n)

space: O(n)

notice use long first

use variables

time: O(n)

space: O(1)

Last updated

Was this helpful?