About the time complexity of the brute force approach

why is it O (n^3)?Why not O( (n^2)*k)?

Do you want me to explain how it’s O(n)?