본문 바로가기

나는 이렇게 학습한다/Algorithm & SQL405

0101. Pillars There are pillars near the road. The distance between the pillars is the same and the width of the pillars is the same. Your function accepts three arguments: number of pillars (≥ 1); distance between pillars (10 - 30 meters); width of the pillar (10 - 50 centimeters). Calculate the distance between the first and the last pillar in centimeters (without the width of the first and last pillar). So.. 2023. 1. 1.
1231. For UFC Fans (Total Beginners): Conor McGregor vs George Saint Pierre This is a beginner friendly kata especially for UFC/MMA fans. It's a fight between the two legends: Conor McGregor vs George Saint Pierre in Madison Square Garden. Only one fighter will remain standing, and after the fight in an interview with Joe Rogan the winner will make his legendary statement. It's your job to return the right statement depending on the winner! If the winner is George Saint.. 2022. 12. 31.
1230. The Wide-Mouthed frog! The wide-mouth frog is particularly interested in the eating habits of other creatures. He just can't stop asking the creatures he encounters what they like to eat. But, then he meets the alligator who just LOVES to eat wide-mouthed frogs! When he meets the alligator, it then makes a tiny mouth. Your goal in this kata is to create complete the mouth_size method this method takes one argument ani.. 2022. 12. 30.
1229. Parts of a list Write a function partlist that gives all the ways to divide a list (an array) of at least two elements into two non-empty parts. Each two non empty parts will be in a pair (or an array for languages without tuples or a structin C - C: see Examples test Cases - ) Each part will be in a string Elements of a pair must be in the same order as in the original array. Examples of returns in different l.. 2022. 12. 30.
1228. Kata Example Twist This is an easy twist to the example kata (provided by Codewars when learning how to create your own kata). Add the value "codewars" to the array websites/Websites 1,000 times. Solution: websites = ["codewars" for _ in range(1000)] websites = ["codewars"] * 1000 2022. 12. 28.
1227. CSV representation of array Create a function that returns the CSV representation of a two-dimensional numeric array. Example: input: [[ 0, 1, 2, 3, 4 ], [ 10,11,12,13,14 ], [ 20,21,22,23,24 ], [ 30,31,32,33,34 ]] output: '0,1,2,3,4\n' +'10,11,12,13,14\n' +'20,21,22,23,24\n' +'30,31,32,33,34' Array's length > 2. Solution: def to_csv_text(array): return '\n'.join(','.join(map(str, i)) for i in array) 2022. 12. 27.