leetle

Daily challenge for 2025-11-07

311. Encode and Decode Strings

Design an algorithm to encode a list of strings to a single string. The encoded string is then decoded back to the original list of strings.

Implement a function that takes a list of strings and returns an encoded string, then decodes it back. For this challenge, return the decoded list after encoding the input.

Example:
Input: strs = ["hello","world"]
Output: ["hello","world"]

Note: The function should encode then decode to verify the process works correctly.

Run this challenge interactively in Python or JavaScript when the app loads.