본문 바로가기

split21

The Hashtag Generator 문제 설명 The marketing team is spending way too much time typing in hashtags. Let's help them with our own Hashtag Generator! Here's the deal: It must start with a hashtag (#). All words must have their first letter capitalized. If the final result is longer than 140 chars it must return false. If the input or the result is an empty string it must return false. Examples " Hello there thanks for try.. 2022. 2. 22.
Stop gninnipS My sdroW! 문제 설명 Write a function that takes in a string of one or more words, and returns the same string, but with all five or more letter words reversed (Just like the name of this Kata). Strings passed in will consist of only letters and spaces. Spaces will be included only when more than one word is present. Examples: spinWords( "Hey fellow warriors" ) => returns "Hey wollef sroirraw" spinWords( "This.. 2022. 2. 15.
이상한 문자 만들기 문제 설명 문자열 s는 한 개 이상의 단어로 구성되어 있습니다. 각 단어는 하나 이상의 공백문자로 구분되어 있습니다. 각 단어의 짝수번째 알파벳은 대문자로, 홀수번째 알파벳은 소문자로 바꾼 문자열을 리턴하는 함수, solution을 완성하세요. 제한 사항 문자열 전체의 짝/홀수 인덱스가 아니라, 단어(공백을 기준)별로 짝/홀수 인덱스를 판단해야합니다. 첫 번째 글자는 0번째 인덱스로 보아 짝수번째 알파벳으로 처리해야 합니다. 해결 방법 1. 문자열을 단어로 쪼갠다. 2. 단어를 반복하며 홀수는 대문자, 짝수는 소문자로 바꾼다. 3. 단어를 공백과 함께 다시 합친다. def solution(s): answer = '' words = s.split(' ') for word in words: for i, s .. 2022. 1. 25.