5 kyu
Exponent method
1,312 of 1,331craecke
Description:
Create a method called "power" that takes two integers and returns the value of the first argument raised to the power of the second. Return nil if the second argument is negative.
Note: The ** operator has been disabled.
Examples:
- power(2, 3) # 8
- power(10, 0) # 1
- power(-5, 3) # -125
- power(-4, 2) # 16
Mathematics
Algorithms
Similar Kata:
Stats:
Created | Oct 6, 2013 |
Published | Oct 6, 2013 |
Warriors Trained | 1764 |
Total Skips | 129 |
Total Code Submissions | 7454 |
Total Times Completed | 1331 |
Ruby Completions | 1312 |
Total Stars | 13 |
% of votes with a positive feedback rating | 83% of 99 |
Total "Very Satisfied" Votes | 72 |
Total "Somewhat Satisfied" Votes | 21 |
Total "Not Satisfied" Votes | 6 |
Total Rank Assessments | 6 |
Average Assessed Rank | 5 kyu |
Highest Assessed Rank | 1 kyu |
Lowest Assessed Rank | 7 kyu |