memory challenge B (#3550)

Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
This commit is contained in:
merwanehamadi
2023-04-29 17:44:21 -07:00
committed by GitHub
parent cdd91f7ea3
commit 6997bb0bdd
4 changed files with 870 additions and 3 deletions

View File

@@ -1,3 +1,4 @@
import random
from typing import Optional
import pytest
@@ -32,3 +33,12 @@ def get_level_to_run(
if user_selected_level > max_level:
raise ValueError(f"This challenge was not designed to go beyond {max_level}")
return user_selected_level
def generate_noise(noise_size) -> str:
return "".join(
random.choices(
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
k=noise_size,
)
)