Skip to Main Content

3-6-9

Problem URL:3-6-9

My Solution

Python

def solve(n):
    num_list = []

    for i in range(1, n+1):
        if i % 3 == 0 or "3" in str(i) or "6" in str(i) or "9" in str(i):
            num_list.append("clap")
        else:
            num_list.append(str(i))

    return num_list

Let's Connect

Twitter GitHub LinkedIn