index17 1019. Is it a palindrome? Write a function that checks if a given string (case insensitive) is a palindrome. Solution: def is_palindrome(s): target = s.lower() for i in range(len(target)//2): if target[i] != target[-i-1]: return False return True def is_palindrome(s): s = s.lower() return s == s[::-1] 2022. 10. 19. 0826. A wolf in sheep's clothing Wolves have been reintroduced to Great Britain. You are a sheep farmer, and are now plagued by wolves which pretend to be sheep. Fortunately, you are good at spotting them. Warn the sheep in front of the wolf that it is about to be eaten. Remember that you are standing at the front of the queue which is at the end of the array: [sheep, sheep, sheep, sheep, sheep, wolf, sheep, sheep] (YOU ARE HER.. 2022. 8. 26. 0824. N-th Power This kata is from check py.checkio.org You are given an array with positive numbers and a non-negative number N. You should find the N-th power of the element in the array with the index N. If N is outside of the array, then return -1. Don't forget that the first element has the index 0. Let's look at a few examples: array = [1, 2, 3, 4] and N = 2, then the result is 3^2 == 9; array = [1, 2, 3] .. 2022. 8. 24. Highest Scoring Word Given a string of words, you need to find the highest scoring word. Each letter of a word scores points according to its position in the alphabet: a = 1, b = 2, c = 3 etc. You need to return the highest scoring word as a string. If two words score the same, return the word that appears earliest in the original string. All letters will be lowercase and all inputs will be valid. Solution: def high.. 2022. 7. 28. SQL Basics - Position You have access to a table of monsters as follows: monsters schema id name legs arms characteristics In each row, the characteristic column has a single comma. Your job is to find it using position(). You must return a table with the format as follows: output schema id name comma The comma column will contain the position of the comma within the characteristics string. Order the results by comma.. 2022. 6. 6. Remove the minimum Description: The museum of incredible dull things The museum of incredible dull things wants to get rid of some exhibitions. Miriam, the interior architect, comes up with a plan to remove the most boring exhibitions. She gives them a rating, and then removes the one with the lowest rating. However, just as she finished rating all exhibitions, she's off to an important fair, so she asks you to wr.. 2022. 4. 20. 이전 1 2 3 다음