Skip to content

LeetCode 271: Encode and Decode Strings #61

@github-actions

Description

@github-actions

LeetCode 271: Encode and Decode Strings

Category: String
Difficulty: See LeetCode
Solution File: src/string/encode_and_decode_strings.py
Test File: tests/test_encode_and_decode_strings.py

Problem Description

Design an algorithm to encode a list of strings to a string. The encoded string is then sent
over the network and is decoded back to the original list of strings.

Implement the encode and decode methods.

Example 1:
Input: dummy_input = ["Hello","World"]
Output: ["Hello","World"]

Example 2:
Input: dummy_input = [""]
Output: [""]

Constraints:

  • 1 <= strs.length <= 200
  • 0 <= strs[i].length <= 200
  • strs[i] contains any possible characters out of 256 valid ASCII characters.

Tasks

  • Implement the solution in src/string/encode_and_decode_strings.py
  • Ensure all test cases pass
  • Analyze time complexity
  • Analyze space complexity

Metadata

Metadata

Assignees

No one assigned

    Labels

    blind-75Blind 75 - Blind-75 problemsstringBlind 75 - String problems

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions