Tap here to switch tabs
Problem
Submissions

Problem: Encode and Decode Strings

Encode and Decode Strings converts an array of strings into one transferable string, then decodes it back into the exact original array, including empty strings and arbitrary characters.

Statement

Create a method, encode, that converts an array of strings into a single string and then sends it over the network. Create another method, decode, that takes the encoded string and converts it back into the original array of strings.

Constraints:

  • 1≤1 \leq strings.length ≤100\leq 100
  • 0≤0 \leq strings[i].length ≤100\leq 100
  • strings[i] consist of any possible combinations of characters from 256 valid ASCII characters.
⋮
Tap here to switch tabs
Problem
Submissions

Problem: Encode and Decode Strings

Encode and Decode Strings converts an array of strings into one transferable string, then decodes it back into the exact original array, including empty strings and arbitrary characters.

Statement

Create a method, encode, that converts an array of strings into a single string and then sends it over the network. Create another method, decode, that takes the encoded string and converts it back into the original array of strings.

Constraints:

  • 1≤1 \leq strings.length ≤100\leq 100
  • 0≤0 \leq strings[i].length ≤100\leq 100
  • strings[i] consist of any possible combinations of characters from 256 valid ASCII characters.