Project Euler #62: Cubic permutations

  • + 2 comments

    please suggest improvements.....can only pass 0 and 1st cases

    i=0;
    cubes=[]
    n,k=map(int,input().split(' ',1))
    while(1):
        cube=sorted(list(str(i**3)))
        cubes.append(cube)
        if(cubes.count(cube)==k):
            print(pow(cubes.index(cube),3))
            break
        i=i+1