Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Using while solution in Clear category for Champernowne Word by H0r4c3
def counting_series(n: int) -> int:
big_string = '1'
number = 1
while len(big_string) < n+1:
number += 1
big_string += str(number)
#print(big_string)
return int(big_string[n])
print("Example:")
print(counting_series(1))
# These "asserts" are used for self-checking
assert counting_series(0) == 1
assert counting_series(10) == 0
assert counting_series(100) == 5
print("The mission is done! Click 'Check Solution' to earn rewards!")
April 1, 2024
Comments: