What is Runtime Complexity?

function reverse(str) {
let reversed = ''
for (let character of str) {
reversed = character + reversed
}
return reversed
}
function square(n) {
let result = 0
for (let i = 1; i <= n; i++) {
for (let j = 1; j <= n; j++) {
result +=1
}
}
return result
}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store