Ones and Zeroes


  • 0

    Click here to see the full article post


  • 0

    Very good solutions. Thanks!


  • 0
    M

    In Approach #5 Dynamic Programming:
    "choosing to put this string in any of the subset possible by using the previous strings traversed so far will impact the element denoted by dp[i][j] for i and j satisfying
    m ≤ i ≤ x, n ≤ j ≤ y"

    isn't the condition supposed to be x ≤ i ≤ m, y ≤ j ≤ n ?


  • 0

    @mnm Thanks for pointing this out. I've updated the conditions now.


  • 0
    S

    Shouldn't inner loop run for strs.length in brute force approach instead of 32?


  • 0

    @pshaikh You are right. I have corrected it.


Log in to reply
 

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