[48in24 Exercise] [06-25] RNA Transcription

This issue is a discussion for contributors to collaborate in getting ready to be featured in 48in24. Please refer to this forum topic for more info.


We will be featuring RNA Transcription from Jun 25 onwards.

Staff jobs

These are things for Erik/Jeremy to do:

  • ☐ Check/update exercise in Problem Specifications
  • ☐ Create + schedule video

Community jobs

For each track:

  • Implement RNA Transcription
  • Add approaches (and an approaches introduction!) for each idiomatic or interesting/educational approach.
  • Add video walkthroughs (record yourself solving and digging deeper into the exercise).
  • Highlight up to 16 different featured exercises (coming soon)

Existing Approaches

You can use these as the basis for approaches on your own tracks. Feel free to copy/paste/reuse/rewrite/etc as you see fit! Maybe ask ChatGPT to translate to your programming language.

Track Statuses

You can see an overview of which tracks have implemented the exercise at the #48in24 implementation status page.

I’ve currently gathered the following solutions to feature:

  1. Ruby: built-in character translate function
    Use the built-in character translation function β€˜tr’

  2. JavaScript: multiple regex replaces using temporary value
    Use multiple regex replaces using a temporary value to prevent doubly translating

  3. Nim: for loop and case statement
    Use a for loop and case statement to match on the characters

  4. MIPS: loop and jumps
    Use loops and jumps

  5. Elixir: map using higher-order function and pattern matching
    Use function clauses to do pattern matching

  6. Haskell: map using higher-order function and pattern matching with error handling
    Use pattern matching, higher-order function and Either type for error handling

  7. Kotlin: map using higher-order function using dictionary
    Map the characters by indexing into a dictionary and using a higher

  8. Prolog: map using higher-order function using (bi-directional) predicates
    Define predicates for complements and use built-in string<->chars predicate with higher order function

  9. C: modulo arithmetic on ASCII value and magic hash
    Use modulo logic on ASCII value and a magic hash

If anyone has more suggestions, do let us know!

C: magic hash (Bad Ideaβ„’)

2 Likes

Nice! Even cooler would be

     res[i] = (dna[i] % 5)["UCG A"];