LeetCode --- 2000. Reverse Prefix of Word 解题报告

Question:

Given a 0-indexed string word and a character chreverse the segment of word that starts at index 0 and ends at the index of the first occurrence of ch (inclusive). If the character ch does not exist in word, do nothing.

  • For example, if word = "abcdefd" and ch = "d", then you should reverse the segment that starts at 0 and ends at 3 (inclusive). The resulting string will be "dcbaefd".

Return the resulting string.

Example 1:

Input: word = "abcdefd", ch = "d"
Output: "dcbaefd"
Explanation: The first

相关推荐

  1. LeetCode --- 2000. Reverse Prefix of Word 解题报告

    2023-12-07 13:56:05       65 阅读
  2. LeetCode --- 2103. Rings and Rods 解题报告

    2023-12-07 13:56:05       19 阅读
  3. LeetCode --- 2129. Capitalize the Title 解题报告

    2023-12-07 13:56:05       23 阅读
  4. LeetCode --- 2032. Two Out of Three 解题报告

    2023-12-07 13:56:05       46 阅读
  5. LeetCode --- 2057. Smallest Index With Equal Value 解题报告

    2023-12-07 13:56:05       37 阅读
  6. LeetCode --- 2073. Time Needed to Buy Tickets 解题报告

    2023-12-07 13:56:05       25 阅读
  7. LeetCode --- 2119. A Number After a Double Reversal 解题报告

    2023-12-07 13:56:05       23 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2023-12-07 13:56:05       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2023-12-07 13:56:05       100 阅读
  3. 在Django里面运行非项目文件

    2023-12-07 13:56:05       82 阅读
  4. Python语言-面向对象

    2023-12-07 13:56:05       91 阅读

热门阅读

  1. 【CTA认证】Android去掉系统应用开机默认使用定位

    2023-12-07 13:56:05       58 阅读
  2. 每日OJ题_算法_双指针②_力扣1089. 复写零

    2023-12-07 13:56:05       66 阅读
  3. CTF 7

    CTF 7

    2023-12-07 13:56:05      52 阅读
  4. frida - 4.hook结合python调用

    2023-12-07 13:56:05       56 阅读
  5. 与时代共进退

    2023-12-07 13:56:05       55 阅读
  6. Python:核心知识点整理大全5-笔记

    2023-12-07 13:56:05       61 阅读
  7. 复习-详解查看Oracle用户权限的几种方法

    2023-12-07 13:56:05       67 阅读
  8. 排序算法的条形图可视化(Python 实现)

    2023-12-07 13:56:05       63 阅读
  9. Vue 与 React

    2023-12-07 13:56:05       59 阅读
  10. FPGA主芯片选型

    2023-12-07 13:56:05       61 阅读
  11. 【BUG】ERROR Place 1115 Unroutable Placement

    2023-12-07 13:56:05       62 阅读