We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6ea295a commit fdb358eCopy full SHA for fdb358e
src/scala/Exponentiation.scala
@@ -1,9 +1,9 @@
1
def exponentiation(base: Int, exponent: Int): Int = {
2
- (1 to exponent)
3
- .map(_ => base)
4
- .reduce(_ * _)
+ (1 to exponent)
+ .map(_ => base)
+ .reduce(_ * _)
5
}
6
7
object Main extends App {
8
- println("5 ^ 3 = " + exponentiation(5, 3));
+ println("5 ^ 3 = " + exponentiation(5, 3));
9
0 commit comments