We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Python, this is my sarcasticly built one line...
But I keep getting a timeout on two of the tests.
Tried basic for loop, itterating a value, sum a list, writing it all out line by line...
[print(sum(map(lambda x: x if x % 3 ==0 or x % 5 == 0 else 0, range(3, int(input()))))) for _ in range(int(input()))]
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #1: Multiples of 3 and 5
You are viewing a single comment's thread. Return to all comments →
Python, this is my sarcasticly built one line... But I keep getting a timeout on two of the tests. Tried basic for loop, itterating a value, sum a list, writing it all out line by line... [print(sum(map(lambda x: x if x % 3 ==0 or x % 5 == 0 else 0, range(3, int(input()))))) for _ in range(int(input()))]