Write a function optimizing:
int-type object n satisfying 0≤n<263int-type object f(n) where f is the following Python function:def f(n):
assert type(n)==int and n>=0
g=lambda n:sum([x**3 for x in range(n)])
x=""
k=0
while n>=len(x):
x+=str(g(k))
k+=1
return int(x[n])