You are viewing a single comment's thread. Return to all comments →
using JS: let currHeight = 1; for(let i = 1; i <= n; i++) { currHeight += (i%2 == 0)? 1:currHeight; } ** return currHeight; **
let currHeight = 1; for(let i = 1; i <= n; i++) { currHeight += (i%2 == 0)? 1:currHeight; } ** return currHeight; **
Seems like cookies are disabled on this browser, please enable them to open this website
Utopian Tree
You are viewing a single comment's thread. Return to all comments →
using JS:
let currHeight = 1; for(let i = 1; i <= n; i++) { currHeight += (i%2 == 0)? 1:currHeight; } ** return currHeight; **