본문 바로가기

lambda17

0209. Sort the Gift Code Happy Holidays fellow Code Warriors! Santa's senior gift organizer Elf developed a way to represent up to 26 gifts by assigning a unique alphabetical character to each gift. After each gift was assigned a character, the gift organizer Elf then joined the characters to form the gift ordering code. Santa asked his organizer to order the characters in alphabetical order, but the Elf fell asleep fro.. 2023. 2. 9.
0131. You only need one - Beginner You will be given an array a and a value x. All you need to do is check whether the provided array contains the value. Array can contain numbers or strings. X can be either. Return true if the array contains the value, false if not. Solution: check: bool = lambda x, y : y in x 2023. 2. 1.
0129. Super Duper Easy Make a function that returns the value multiplied by 50 and increased by 6. If the value entered is a string it should return "Error". Solution: problem = lambda x: "Error" if isinstance(x, str) else x * 50 + 6 2023. 1. 29.
0126. Over The Road Task You've just moved into a perfectly straight street with exactly n identical houses on either side of the road. Naturally, you would like to find out the house number of the people on the other side of the street. The street looks something like this: Street 1| |6 3| |4 5| |2 you Evens increase on the right; odds decrease on the left. House numbers start at 1 and increase without gaps. When .. 2023. 1. 27.
0117. get character from ASCII Value Write a function get_char() / getChar() which takes a number and returns the corresponding ASCII char for that value. Example: get_char(65) should return: 'A' Solution: get_char = lambda x: chr(x) 2023. 1. 18.
0114. Are arrow functions odd? Time to test your basic knowledge in functions! Return the odds from a list: [1, 2, 3, 4, 5] --> [1, 3, 5] [2, 4, 6] --> [] Solution: odds = lambda x: [i for i in x if i & 1] 2023. 1. 15.