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
- python sorted
- 릿코드 파이썬
- 파이썬알고리즘풀기
- leetcode풀이
- python 알고리즘
- python priority queue
- 코틀린기초
- 파이썬릿코드
- 파이썬릿코드풀기
- python xor
- binary search
- 파이썬 알고리즘
- python Leetcode
- 파이썬 프로그래머스
- 알고리즘풀이
- leetcode풀기
- leetcode 풀기
- 파이썬 릿코드
- 알고리즘풀기
- 파이썬 알고리즘 풀기
- 잇츠디모
- 파이썬알고리즘
- 릿코드풀기
- 상가수익률계산기
- 릿코드풀이
- 릿코드 풀기
- 릿코드
- python 릿코드
- LeetCode
- python zip_longest
Archives
- Today
- Total
소프트웨어에 대한 모든 것
LeetCode 풀기 - 1816. Truncate Sentence 본문
반응형
1816. Truncate Sentence
https://leetcode.com/problems/truncate-sentence/
문제)
솔루션1)
class Solution:
def truncateSentence(self, s: str, k: int) -> str:
return ' '.join(s.split()[:k])
반응형
'알고리즘 > LeetCode' 카테고리의 다른 글
LeetCode 풀기 - 1941. Check if All Characters Have Equal Number of Occurrences (0) | 2021.11.06 |
---|---|
LeetCode 풀기 - 1844. Replace All Digits with Characters (0) | 2021.11.05 |
LeetCode 풀기 - 1913. Maximum Product Difference Between Two Pairs (0) | 2021.11.05 |
LeetCode 풀기 - 70. Climbing Stairs (0) | 2021.11.05 |
LeetCode 풀기 - 380. Insert Delete GetRandom O(1) (0) | 2021.11.03 |
Comments