7 kyu

Simple Fun #137: S2N

166 of 440myjinxin2015

Description:

Task

Your task is to find the sum for the range 0 ... m for all powers from `0 ... n.

Example

For m = 2, n = 3, the result should be 20

0^0+1^0+2^0 + 0^1+1^1+2^1 + 0^2+1^2+2^2 + 0^3+1^3+2^3 = 20

Note, that no output ever exceeds 2e9.

Input/Output

  • [input] integer m

0 <= m <= 50000

  • [input] integer n

0 <= n <= 9

  • [output] an integer(double in C#)

The sum value.

Puzzles

Stats:

CreatedFeb 17, 2017
PublishedFeb 17, 2017
Warriors Trained621
Total Skips2
Total Code Submissions811
Total Times Completed440
JavaScript Completions166
C# Completions57
Python Completions227
Ruby Completions35
Total Stars6
% of votes with a positive feedback rating91% of 141
Total "Very Satisfied" Votes119
Total "Somewhat Satisfied" Votes19
Total "Not Satisfied" Votes3
Total Rank Assessments8
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • myjinxin2015 Avatar
  • jhoffner Avatar
  • hobovsky Avatar
  • dfhwze Avatar
  • Just4FunCoder Avatar
  • saudiGuy Avatar
Ad