알고리즘/코드워 65

[python]Highest Scoring Word

https://www.codewars.com/kata/57eb8fcdf670e99d9b000272/train/python Codewars: Train your coding skills Codewars is where developers achieve code mastery through challenge. Train on kata in the dojo and reach your highest potential. www.codewars.com 문자열에서 합이 가장 큰 단어 찾는 문제이다. 더보기 내 코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 # My Code def high(x): answer_ = [] sum_ = 0 for i in x: if ..

[python]Build Tower

https://www.codewars.com/kata/576757b1df89ecf5bd00073b/train/python Codewars: Train your coding skills Codewars is where developers achieve code mastery through challenge. Train on kata in the dojo and reach your highest potential. www.codewars.com 별로 탑을 쌓아서 출력하는 문제이다. 문제를 풀기 위해 필요한 것 1. 스페이스와 *을 조합 수식 찾기 더보기 스페이스와 *의 조합 스페이스와 *이 눈으로 보기에 적합하지 않아서 스페이스를 X, *를 O로 바꾸어서 풀어보았다. 한 변의 X 수와 O의 수를 구해 보았다..

[python]Equal Sides Of An Array

https://www.codewars.com/kata/5679aa472b8f57fb8c000047/train/python Codewars: Train your coding skills Codewars is where developers achieve code mastery through challenge. Train on kata in the dojo and reach your highest potential. www.codewars.com 주어진 배열에서 한 개의 인덱스를 기준으로 왼쪽과 오른쪽의 합이 같은 인덱스를 찾는 문제이다. 문제를 풀기 위해 필요한 것 1. 합 구하기 2. 왼쪽과 오른쪽 비교 더보기 합 구하기 : sum(구하고 싶은 값들의 집합) 왼쪽과 오른쪽 비교 : if left == ri..

[python]Shortest Word

https://www.codewars.com/kata/57cebe1dc6fdc20c57000ac9/train/python Codewars: Train your coding skills Codewars is where developers achieve code mastery through challenge. Train on kata in the dojo and reach your highest potential. www.codewars.com 문자열에서 가장 짧은 단어의 길이를 구하는 문제이다. 문제를 풀기 위해 필요한 것 1. 문자열을 단어 별로 자르기 2. 단어의 길이 구하기 3. 단어들의 최솟값 찾기 더보기 문자열을 단어 별로 자르기 : 문자열.split() 단어의 길이 구하기 : len(문자열) 단..

[python]Counting Duplicates

https://www.codewars.com/kata/54bf1c2cd5b56cc47f0007a1/train/python Codewars: Train your coding skills Codewars is where developers achieve code mastery through challenge. Train on kata in the dojo and reach your highest potential. www.codewars.com 문자열에서 대소문자 상관없이 2개 이상 반복되는 문자의 개수를 찾는 문제이다. 문제를 풀기 위해 필요한 것 1. 문자열을 대문자나 소문자로 변형 2. 중복되는 문자 제거 3. 문자열에 존재하는 문자 세기 더보기 문자열 대문자 : 문자열.upper() 문자열 소문자 :..

728x90