Search⌘ K
AI Features

Solution: Stickers to Spell Word

Let's solve the Stickers to Spell Word problem using the Dynamic Programming pattern.

Statement

Given an array stickers of n distinct sticker types, where each sticker contains a lowercase English word, determine the minimum number of stickers needed to spell out the string target. Individual letters may be cut from any sticker and rearranged freely. Each sticker type is available in unlimited quantities and may be used more than once. If it is impossible to spell target, return 1-1.

Constraints:

  • n == stickers.length

  • 11 \leq n 50\leq 50 ...