Skip to content

Bug Report for word-break-ii #5771

@samuelyutt

Description

@samuelyutt

Bug Report for https://neetcode.io/problems/word-break-ii

Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.

This test case is wrong:

s = "pineapplepenapple"
wordDict=["apple","pen","applepen","pine","pineapple"]

s somehow includes a white space char so the given answer is []
however, the problem claims that s contains only lowercase chars

to temporarily fix it, i had to add this to my solution

if not 0 <= ord(s[i]) - ord('a') < 26:
    return

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions