五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

LeetCode 2810. Faulty Keyboard

2023-08-10 11:03 作者:您是打尖兒還是住店呢  | 我要投稿

Your laptop keyboard is faulty, and whenever you type a character?'i'?on it, it reverses the string that you have written. Typing other characters works as expected.

You are given a?0-indexed?string?s, and you type each character of?s?using your faulty keyboard.

Return?the final string that will be present on your laptop screen.

?

Example 1:

Input: s = "string"Output: "rtsng"Explanation: After typing first character, the text on the screen is "s". After the second character, the text is "st". After the third character, the text is "str". Since the fourth character is an 'i', the text gets reversed and becomes "rts". After the fifth character, the text is "rtsn". After the sixth character, the text is "rtsng". Therefore, we return "rtsng".

Example 2:

Input: s = "poiinter"Output: "ponter"Explanation: After the first character, the text on the screen is "p". After the second character, the text is "po". Since the third character you type is an 'i', the text gets reversed and becomes "op". Since the fourth character you type is an 'i', the text gets reversed and becomes "po". After the fifth character, the text is "pon". After the sixth character, the text is "pont". After the seventh character, the text is "ponte". After the eighth character, the text is "ponter". Therefore, we return "ponter".

?

Constraints:

  • 1 <= s.length <= 100

  • s?consists of lowercase English letters.

  • s[0] != 'i'

----------------------------------------------------


Runtime:?3 ms, faster than?98.76%?of?Java?online submissions for?Faulty Keyboard.

Memory Usage:?43.6 MB, less than?83.32%?of?Java?online submissions for?Faulty Keyboard.



LeetCode 2810. Faulty Keyboard的評論 (共 條)

分享到微博請遵守國家法律
高陵县| 通渭县| 科尔| 华池县| 白山市| 马鞍山市| 额尔古纳市| 永康市| 肇庆市| 金山区| 嘉定区| 广灵县| 阜新市| 双峰县| 曲沃县| 永和县| 怀远县| 呼伦贝尔市| 麻栗坡县| 福贡县| 满城县| 平昌县| 湘潭县| 泰来县| 襄樊市| 信丰县| 嘉兴市| 天峻县| 利川市| 宁城县| 仪征市| 杂多县| 莱芜市| 桃园市| 沅陵县| 蛟河市| 潞西市| 宁安市| 谢通门县| 定远县| 墨竹工卡县|