일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- FOR
- js
- MAX
- sum
- Python
- and
- DART
- index
- iNT
- split
- map
- len
- decorator
- or
- list
- Algorithm
- Sorted
- lambda
- join
- 위코드
- STR
- 파이썬
- WECODE
- range
- If
- enumerate
- SQL
- slice
- count
- LOWER
- Today
- Total
목록len (31)
코드로 우주평화
Complete the function that takes two numbers as input, num and nth and return the nth digit of num (counting from right to left). Note If num is negative, ignore its sign and treat it as a positive value If nth is not positive, return -1 Keep in mind that 42 = 00042. This means that findDigit(42, 5) would return 0 Examples(num, nth --> output) 5673, 4 --> 5 129, 2 --> 2 -2825, 3 --> 8 -456, 4 --..
Write a function reverse which reverses a list (or in clojure's case, any list-like data structure) (the dedicated builtin(s) functionalities are deactivated) Solution: def reverse(lst): result = list() for _ in range(len(lst)): result.append(lst.pop()) return result
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..
Your task is simply to count the total number of lowercase letters in a string. Examples lowercaseCount("abc"); ===> 3 lowercaseCount("abcABC123"); ===> 3 lowercaseCount("abcABC123!@€£#$%^&*()_-+=}{[]|\':;?/>.
Implement String#digit? (in Java StringUtils.isDigit(String)), which should return true if given object is a digit (0-9), false otherwise. Solution: def is_digit(n): return len(n) == 1 and n.isdigit()
Task Given an array of integers , Find the maximum product obtained from multiplying 2 adjacent numbers in the array. Notes Array/list size is at least 2. Array/list numbers could be a mixture of positives, negatives also zeroes . Input >> Output Examples adjacentElementsProduct([1, 2, 3]); ==> return 6 Explanation: The maximum product obtained from multiplying 2 * 3 = 6, and they're adjacent nu..
Exclusive "or" (xor) Logical Operator Overview In some scripting languages like PHP, there exists a logical operator (e.g. &&, ||, and, or, etc.) called the "Exclusive Or" (hence the name of this Kata). The exclusive or evaluates two booleans. It then returns true if exactly one of the two expressions are true, false otherwise. For example: false xor false == false // since both are false true x..
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]
Palindrome strings A palindrome is a word, phrase, number, or other sequence of characters which reads the same backward or forward. This includes capital letters, punctuation, and word dividers. Implement a function that checks if something is a palindrome. If the input is a number, convert it to string first. Examples(Input ==> Output) "anna" ==> true "walter" ==> false 12321 ==> true 123456 =..
Given an array of integers. Return an array, where the first element is the count of positives numbers and the second element is sum of negative numbers. 0 is neither positive nor negative. If the input is an empty array or is null, return an empty array. Example For input [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -11, -12, -13, -14, -15], you should return [10, -65]. Solution: def sorted_arr(func): def w..