urlname
type
Post
password
SyncToConfluence
category
Leetcode
date
Mar 10, 2023 22:23
slug
0206258a59cf
icon
Button
catalog
summary
tags
Algorithm
动态规划
cover
Status
BusyTime
Status 1
status
Published

题目链接

关键词

{% label 动态规划 yellow %}、{% label 字符串 green %}

解析

  • 定义 dp[i],表示 s[0~i] 可以被字典 wordDict 组成
  • 则状态方程:dp[i] = dp[j] & wordDict.contains(s.substring(j, i))

代码

相似题目

Leetcode_718-最长重复子数组Native-so库优化
Loading...