8 kyu
Powers of 2
874 of 69,146wichu
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 | 104275 |
Total Skips | 8050 |
Total Code Submissions | 159054 |
Total Times Completed | 69146 |
Haskell Completions | 874 |
Python Completions | 24100 |
CoffeeScript Completions | 47 |
JavaScript Completions | 26634 |
Ruby Completions | 1534 |
C# Completions | 2368 |
F# Completions | 299 |
OCaml Completions | 296 |
Julia Completions | 71 |
Java Completions | 4690 |
C++ Completions | 5193 |
C Completions | 1286 |
COBOL Completions | 34 |
λ Calculus Completions | 19 |
Factor Completions | 23 |
Go Completions | 2021 |
Lua Completions | 244 |
RISC-V Completions | 34 |
BF Completions | 55 |
TypeScript Completions | 833 |
Rust Completions | 724 |
D Completions | 18 |
Prolog Completions | 11 |
PHP Completions | 134 |
Total Stars | 626 |
% of votes with a positive feedback rating | 92% of 5193 |
Total "Very Satisfied" Votes | 4404 |
Total "Somewhat Satisfied" Votes | 700 |
Total "Not Satisfied" Votes | 89 |