java - 唯一字母字符串(Leetcode)
问题描述
我试图解决这个问题(https://leetcode.com/problems/unique-letter-string/description/),但我无法理解问题陈述。
解释如下:
Input: "ABC"
Output: 10
Explanation: All possible substrings are: "A","B","C","AB","BC" and "ABC".
Evey substring is composed with only unique letters.
Sum of lengths of all substring is 1 + 1 + 1 + 2 + 2 + 3 = 10
我不明白的是为什么所有可能的子字符串中都缺少子字符串“AC” 。
由于有几个人提交了与上述解释相匹配的答案而没有任何问题,看来我对子字符串的理解是错误的。任何人都可以在这里帮助我理解吗?
解决方案
推荐阅读
- python - Raspberry Pi Python 继续循环移动函数,直到特定命令停止它
- php - Codeigniter 分页将我引导至“about:blank#blocked”
- java - 原因:java.net.URISyntaxException:索引 111 处的查询中存在非法字符:由于 URI 中的 {} 出现错误
- python - 从文件创建环境而无需其他依赖项
- reactjs - 我在哪里可以找到 FontAwesome 免费包中图标的对象名称?
- php - 索引页面不显示 db 的对象或有时显示未定义的变量
- html - 如何以以下方式在表格的单元格内叠加图像?
- excel - 使用 microsoft graph api 将 Excel 文件 (.xlsx) 转换为 PDF 忽略页面设置说明
- javascript - url 字符串中包含“v0”的 Firebase 存储下载 URL
- azure-webjobs - 如何为“webjobs v3”中的不同队列配置不同的批处理大小?