

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: Alphabet Formula
incomplete
2: Brute Force Attacks
incomplete
3: Crack an Insecure Key
incomplete
4: Entropy
incomplete
This lesson's interactive features are locked, please to keep using them
The number of total characters in an alphabet depends on how many bits each character in an encoded string can represent.
Notice how the number of characters grows exponentially based on the number of bits. The number of characters is equal to the number of combinations that can be created by the individual bits.
00 = char 0
01 = char 1
10 = char 2
11 = char 3
So with 2 bits, we can represent 4 characters in total.
Complete the alphabetSize() function. It accepts a number of bits per character as input, and returns the size of the alphabet that can be represented by that number of bits.