03 2024 档案

摘要:已知字符'A',给定输入数量n,怎么用最少的操作数实现得到数量n的字符'A' 操作有CtrlA,CtrlC,CtrlV,CtrlS #include <iostream> #include <vector> using namespace std; int minOperations(int n) 阅读全文
posted @ 2024-03-31 12:07 Kellen_Gram 阅读(21) 评论(0) 推荐(0) 编辑
摘要:开个坑,后续补解析 class Solution { public: int countSubstrings(string s) { int n = s.size(); string t = "$#"; for (const char &c: s) { t += c; t += '#'; } n = 阅读全文
posted @ 2024-03-26 10:09 Kellen_Gram 阅读(9) 评论(0) 推荐(0) 编辑
摘要:1.题目 给你两个单词 word1 和 word2, 请返回将 word1 转换成 word2 所使用的最少操作数 。 你可以对一个单词进行如下三种操作: 删除一个字符 替换一个字符 插入一个字符 示例: 输入:word1 = "horse", word2 = "ros" 输出:3 解释: hors 阅读全文
posted @ 2024-03-26 08:46 Kellen_Gram 阅读(200) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示