Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 | 31 |
Tags
- C++
- const
- 오블완
- 백준
- OOP
- Object Oriented Programming
- Data Science
- 반복문
- 파이썬
- string
- 포인터
- 배열
- 문자열
- assignment operator
- vscode
- function
- Class
- raw data
- pass by reference
- 티스토리챌린지
- 함수
- Python
- predictive analysis
- 알고리즘
- programming
- baekjoon
- Deep Learning
- pointer
- array
- Pre-processing
Archives
- Today
- Total
목록Programmers (1)
Channi Studies
문제 for문 내에서 queires 내의 index들을 반복적으로 my_string에 적용시키면서, 적용된 내용을 다시 my_string에 저장하는 방식으로 하면 될 것 같다. 코드 및 설명 def solution(my_string, queries): result = my_string for index in queries: front_string = result[:index[0]] mid_string = result[index[0]: index[1] + 1] back_string = result[index[1] + 1:len(result)] result = front_string + mid_string[::-1] + back_string return result for문 속의 string slicing ..
python
2023. 10. 11. 15:23