Notice
Recent Posts
Recent Comments
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 |
Tags
- ChatGPT
- SW Expert Academy
- github
- Real or Not? NLP with Disaster Tweets
- 백준
- 더현대서울 맛집
- Kaggle
- dacon
- 편스토랑 우승상품
- Baekjoon
- Git
- 프로그래머스 파이썬
- PYTHON
- 캐치카페
- Docker
- 우분투
- AI 경진대회
- 프로그래머스
- 편스토랑
- ubuntu
- 금융문자분석경진대회
- 맥북
- 자연어처리
- programmers
- 파이썬
- hackerrank
- leetcode
- 데이콘
- gs25
- 코로나19
Archives
- Today
- Total
솜씨좋은장씨
[leetCode] 2000. Reverse Prefix of Word (Python) 본문
728x90
반응형

코딩 1일 1문제! 오늘의 문제는 leetCode의 Reverse Prefix of Word 입니다.
Reverse Prefix of Word - LeetCode
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
leetcode.com
👨🏻💻 코드 ( Solution )
class Solution:
def reversePrefix(self, word: str, ch: str) -> str:
check_idx = word.find(ch)
if check_idx != -1:
word = word[:check_idx + 1][::-1] + word[check_idx+1:]
return word

https://github.com/SOMJANG/CODINGTEST_PRACTICE
GitHub - SOMJANG/CODINGTEST_PRACTICE: 1일 1문제 since 2020.02.07
1일 1문제 since 2020.02.07. Contribute to SOMJANG/CODINGTEST_PRACTICE development by creating an account on GitHub.
github.com
'Programming > 코딩 1일 1문제' 카테고리의 다른 글
| [BaekJoon] 13706번 : 제곱근 (Python) (1) | 2022.01.30 |
|---|---|
| [BaekJoon] 2163번 : 초콜릿 자르기 (Python) (0) | 2022.01.29 |
| [leetCode] 1945. Sum of Digits of String After Convert (Python) (0) | 2022.01.27 |
| [leetCode] 2108. Find First Palindromic String in the Array (Python) (0) | 2022.01.26 |
| [leetCode] 1291. Sequential Digits (Python) (0) | 2022.01.25 |
Comments