If you can’t code, you have no business managing engineers

def function(x: Int): Int = {
def loop(y: Int, total: Int): Int = {
if(y == 0) total
else loop(y - 1, total * y)
}
loop(x, 1)
}
function(5)
def function(x: Int): Int = {
if(x == 0) 1
else x * function(x - 1)
}
function(5)

Leading the Troops

Get Coding Again

Thanks for reading!

If you enjoyed this article, feel free to hit that clap button below 👏 to help others find it!

--

--

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