Omid - Challenge 311

data-challenges
advanced-exercises
🔰 Possible Result Challenge 311 : Random Generation!
Published

March 24, 2026

Illustration for Omid - Challenge 311

Challenge Description

🔰 Possible Result Challenge 311 : Random Generation!

Solutions

sample(1:8,1) + 0:2
  • Logic:

    • Applies the workbook rule directly and returns the expected output shape
  • Strengths:

    • The R solution stays close to the workbook rule and keeps the transformation compact.
  • Areas for Improvement:

    • The code assumes the sheet structure and source ranges remain stable.
  • Gem:

    • The strongest part of the solution is choosing the right intermediate representation before shaping the final output.
from random import*
print([*range(i:=randint(1,8),i+3)])
  • Logic:

    • Applies the workbook rule directly and returns the expected output shape
  • Strengths:

    • The Python version follows the same rule in a direct dataframe-oriented implementation.
  • Areas for Improvement:

    • The code assumes the workbook layout remains stable, so any sheet redesign would require small adjustments.
  • Gem:

    • The implementation stays close to the original workbook rule instead of adding unnecessary abstraction.

Difficulty Level

This task is moderate:

  • The business rule is readable, but the workbook still requires careful implementation to reach the expected layout.