394

[LeetCode Hot 100] LeetCode394. 字符串解码

题目描述 思路 思路: 碰到数字:压入数字栈,注意多位数的情况 碰到字母:直接拼接到res 遇到[:将num和res分别压入栈 遇到]:开始处理栈顶元素 方法一: class Solution { public String decodeString(String s) { int num = 0; ......
LeetCode 字符串 字符 Hot 100

394. 字符串解码

给定一个经过编码的字符串,返回它解码后的字符串。 编码规则为: k[encoded_string],表示其中方括号内部的 encoded_string 正好重复 k 次。注意 k 保证为正整数。 你可以认为输入字符串总是有效的;输入字符串中没有额外的空格,且输入的方括号总是符合格式要求的。 此外,你 ......
字符串 字符 394

LeetCode -- 394. 字符串解码(栈处理字符串问题)

我们用栈同时维护当前字符串和倍数以及要加倍的字符串 当遇到"["时,我们保存当前字符串,即将当前字符 cres 串入栈; 当遇到"]"时,res = cres + 倍数 * 应加倍的字符串 class Solution: def decodeString(self, s: str) -> str: ......
字符串 字符 LeetCode 问题 394

Leetcode394. 字符串解码

``` class Solution { public: string dfs(string s,int &idx) { string str; while(idx'0'&&s[idx]='0'&&s[idx]<='9') num+=s[idx++]; if(s[idx]=='[') { int c ......
字符串 字符 Leetcode 394

学习笔记394—Windows 10 MySQL 数据库安装

Windows 10 MySQL 数据库安装 1、MySQL 的安装方式 MySQL 的社区版(MySQL Community)是免费的、开源的,像企业版这些是收费的,学习阶段使用社区版的即可。 MySQL 社区版在 Windows 10 的安装方式可以分为两种,一种是使用安装程序安装,另一种是使用 ......
Windows 数据库 笔记 数据 MySQL

leetcode 394.字符串解码 Java

394.字符串解码 给定一个经过编码的字符串,返回它解码后的字符串。 编码规则为: k[encoded_string],表示其中方括号内部的 encoded_string 正好重复 k 次。注意 k 保证为正整数。 你可以认为输入字符串总是有效的;输入字符串中没有额外的空格,且输入的方括号总是符合格 ......
字符串 字符 leetcode Java 394
共6篇  :1/1页 首页上一页1下一页尾页