8 kyu
Powers of 2
862 of 67,586wichu
Description:
Complete the function that takes a non-negative integer n
as input, and returns a list of all the powers of 2
with the exponent ranging from 0
to n
( inclusive ).
Examples
n = 0 ==> [1] # [2^0]
n = 1 ==> [1, 2] # [2^0, 2^1]
n = 2 ==> [1, 2, 4] # [2^0, 2^1, 2^2]
Mathematics
Fundamentals
Similar Kata:
Stats:
Created | Aug 2, 2016 |
Published | Aug 2, 2016 |
Warriors Trained | 102158 |
Total Skips | 7824 |
Total Code Submissions | 155797 |
Total Times Completed | 67586 |
Haskell Completions | 862 |
Python Completions | 23495 |
CoffeeScript Completions | 46 |
JavaScript Completions | 26260 |
Ruby Completions | 1527 |
C# Completions | 2313 |
F# Completions | 297 |
OCaml Completions | 292 |
Julia Completions | 69 |
Java Completions | 4580 |
C++ Completions | 4993 |
C Completions | 1258 |
COBOL Completions | 34 |
λ Calculus Completions | 19 |
Factor Completions | 23 |
Go Completions | 1913 |
Lua Completions | 233 |
RISC-V Completions | 33 |
BF Completions | 52 |
TypeScript Completions | 790 |
Rust Completions | 696 |
D Completions | 15 |
Prolog Completions | 11 |
PHP Completions | 100 |
Total Stars | 616 |
% of votes with a positive feedback rating | 92% of 5131 |
Total "Very Satisfied" Votes | 4351 |
Total "Somewhat Satisfied" Votes | 692 |
Total "Not Satisfied" Votes | 88 |