전체 글


from collections import Counterdef solution(X, Y): count_x = Counter(X) count_y = Counter(Y) common_digit = set(X) & set(Y) result = [] for digit in common_digit: min_count = min(count_x[digit], count_y[digit]) result.extend([digit] * min_count) result.sort(reverse=True) if len(result) == 0: return '-1' if result[0] == '0': return '..


def draw_stars(n): # 기본 패턴 생성 if n == 1: return ['*'] # 크기가 (n/3)인 패턴 생성 stars = draw_stars(n//3) result = [] for star in stars: result.append(star * 3) for star in stars: result.append(star + ' ' * (n//3) + star) for star in stars: result.append(star * 3) return result n = int(input())print('\n'.join(draw_stars(n)))