CHIqueen
def allLongestStrings(inputArray): maxd = 0 for i in inputArray: maxd = max(maxd,len(i)) return [i for i in inputArray if len(i) == maxd] 나머지 풀이들을 봤는데 max함수에 key를 len으로만 줘서 반복문 돌릴필요가 없었던것이 신기했다. def allLongestStrings(inputArray): return [i for i in inputArray if len(i) == len(max(inputArray, key=len))]
After becoming famous, the CodeBots decided to move into a new building together. Each of the rooms has a different cost, and some of them are free, but there's a rumour that all the free rooms are haunted! Since the CodeBots are quite superstitious, they refuse to stay in any of the free rooms, or any of the rooms below any of the free rooms. Given matrix, a rectangular matrix of integers, wher..
Below we will define an n-interesting polygon. Your task is to find the area of a polygon for a given n. A 1-interesting polygon is just a square with a side of length 1. An n-interesting polygon is obtained by taking the n - 1-interesting polygon and appending 1-interesting polygons to its rim, side by side. You can see the 1-, 2-, 3- and 4-interesting polygons in the picture below. func shapeA..