```
int foo(int n) 
{
    int x=2;
    while (x<n)
    {
        x = x*x*x;
    }

    return x;
}

```

I need to analyze its time complexity. I noticed it reaches `n` much faster than just `log(n)`. I mean, it does less steps than `O(log(n))` would do. I read the answer but have no idea how they got to it: It is `O(log(log(n))`. Now, how do you approach such a question?