2390

leetcode2390双指针一个指针写一个指针读

while(scan<s.size()){ if(s[scan]== '*'){ write==0?write:write--; scan++; continue; } s[write++]=s[scan++]; return s.substr(0,write); } ......
指针 leetcode 2390

力扣---2390. 从字符串中移除星号

给你一个包含若干星号 * 的字符串 s 。 在一步操作中,你可以: 选中 s 中的一个星号。移除星号 左侧 最近的那个 非星号 字符,并移除该星号自身。返回移除 所有 星号之后的字符串。 注意: 生成的输入保证总是可以执行题面中描述的操作。可以证明结果字符串是唯一的。 示例 1: 输入:s = "l ......
星号 字符串 字符 2390

[LeetCode] 2390. Removing Stars From a String

You are given a string s, which contains stars *. In one operation, you can: Choose a star in s. Remove the closest non-star character to its left, as ......
LeetCode Removing String Stars 2390
共3篇  :1/1页 首页上一页1下一页尾页