Challenge 7 Nested Loop with Multiplication (Pro)

Why is the number of executions of line 9 while (j < i) is log_2(n) ?

Shouldn’t it be n ?

In the solution for Java, the number of executions of while (j < i) is n.

I don’t understand how it is calculated and why it’s different for JS and Java.

Could you please explain how it is calculated?

Course: https://www.educative.io/collection/5642554087309312/5663204961157120

Lesson: https://www.educative.io/collection/page/5642554087309312/5663204961157120/5650387168133120