코드워 38

[python]Polish alphabet

https://www.codewars.com/kata/57ab2d6072292dbf7c000039/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 이 문제는 폴란드 알파벳의 분음 부호를 사용하여 글자를 변경하는 것입니다. python에서는 replace를 이용하면 쉽게 문제를 풀 수 있습니다. replace 외에도 maketrans나 st 문자열을 하나씩 나누어서 if 문을 이용하여 문제를 풀 수도 있습니다. ..

[python]Largest 5 digit number in a series

https://www.codewars.com/kata/51675d17e0c1bed195000001/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 이 문제는 길이가 5 이상인 숫자(예를 들어 12345, 123456 등)를 5개씩 쪼개서 최댓값을 반환하면 되는 문제입니다. 예를 들어서 1234567898765일 경우 아래와 같이 쪼개어볼 수 있습니다. 12345, 23456, 34567, 45678, 56789..

[python]Sudoku Solution Validator

https://www.codewars.com/kata/529bf0e9bdf7657179000008/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 Sudoku Solution Validator 스도쿠는 숫자 퍼즐로 가로 9칸, 세로 9칸으로 이루어져 있는 표에 1부터 9까지의 숫자를 채워 넣는 퍼즐입니다. 퍼즐을 푸는 방법은 같은 줄에는 1에서 9까지의 숫자를 한 번만 넣고, 3x3칸의 작은 격자 또한 1에서 ..

[python]Get Planet Name By ID

https://www.codewars.com/kata/515e188a311df01cba000003/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 python에서는 switch문이 없습니다. switch문 없이 id를 입력받았을 때 다른 값이 출력될 수 있도록 코드를 만들면 됩니다. 간단하게 2가지 방법을 소개해보겠습니다. 1. if와 elif를 사용하는 방법 # 1. if와 elif 사용 def get_pla..

[python]Total amount of points

https://www.codewars.com/kata/5bb904724c47249b10000131/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 Total amount of points x:y 인 형태로 점수가 들어 있는 배열을 입력받아서 x가 y보다 클 경우는 포인트를 3점 더하고 x가 y와 같을 경우는 1을 더한 후 포인트를 되돌려주면 됩니다. 우선적으로 배열 안의 x:y만 출력되도록 만들어보면 아래의 코..

[python]Did I Finish my Sudoku?

https://www.codewars.com/kata/53db96041f1a7d32dc0004d2/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 이번 제 코드는 효율적인 코드는 아닌 것 같습니다. 제 코드는 참고만 하시고 직접 풀어보시는 것을 추천드립니다. 풀이를 보시려면 더보기를 클릭하시면 됩니다. 더보기 Did I Finish my Sudoku? 스도쿠는 숫자 퍼즐로, 가로 9칸, 세로 9칸으로 이루어져 ..

[python]Sudoku Solver

https://www.codewars.com/kata/5296bc77afba8baa690002d7/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 풀이를 보시려면 더보기를 클릭하시면 됩니다. 더보기 Sudoku Solver 스도쿠는 숫자 퍼즐로, 가로 9칸, 세로 9칸으로 이루어져 있는 표에 1부터 9까지의 숫자를 채워 넣는 퍼즐입니다. 퍼즐을 푸는 방법은 같은 줄에는 1에서 9까지의 숫자를 한 번만 넣고, 3..

[python]Make a spiral

https://www.codewars.com/kata/534e01fbbb17187c7e0000c6/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 더보기 내 코드 출력 답을 보았을 때 회오리 모양처럼 보여서 0으로 초기화된 리스트에 회전을 시키면서 값을 1로 바꾸었다. 아래는 N이 5일 때(문제에서 최소 N이 5이다.) 회전하는 모습을 나타낸 것이다. N이 10일 경우는 아래와 같다. N이 10일 경우 아래와 ..

728x90