Re: [閒聊] 每日LeetCode

作者: Rushia (みけねこ的鼻屎)   2022-11-08 09:27:49
1544. Make The String Great
龍大是個字串處理員他會收到很多字串,如果這個字串壞掉了他就要把字串壞掉的部分切
掉,一個字串是「好」的他必須滿足:
* 任意兩個相鄰字串不可以是一個大寫一個小寫的英文字母
例如:leE(eE是壞的所以要切掉讓他變l)
字串只包含大小寫英文字母。
Example1:
Input: s = "leEeetcode"
Output: "leetcode"
Explanation: In the first step, either you choose i = 1 or i = 2, both will
result "leEeetcode" to be reduced to "leetcode".
Example2:
Input: s = "abBAcC"
Output: ""
Explanation: 刪除的順序可能有多種:
"abBAcC"
作者: p54661205 (APK)   2022-11-08 09:30:00
大師
作者: pandix (麵包屌)   2022-11-08 09:38:00
大師java不能直接把stack轉陣列喔 好麻煩
作者: Rushia (みけねこ的鼻屎)   2022-11-08 09:40:00
:(可以轉泛型陣列Character[] 但是沒啥用因為String沒有對應的建構式 只能接受char[]
作者: PyTorch (屁眼火炬)   2022-11-08 09:50:00
大師

Links booklink

Contact Us: admin [ a t ] ucptt.com