💥💥 O(n) on runtime and memory [EXPLAINED]
IntuitionSplit a long message into smaller parts, each with a specific length, and append a suffix showing its index and total number of parts. The suffix must
# Intuition
Split a long message into smaller parts, each with a specific length, and append a suffix showing its index and total number of parts. The suffix must fit within the given length limit, and we need to minimize the number of parts while ensuring all parts, when combined, reconstruct the original message.

# Approach
Start by determining the number of parts needed based on the length limit and the space taken by the suffix; once the number of parts is found, slice the message into parts and append the suffix for each part.

# Complexity
- Time complexity:
 O(n), where n is the length of the message. We traverse the message and the parts only once.

- Space complexity:
O(n), as we store the result in a list of strings that hold each part of the message.

# Code
```rust []
impl Solution {
    pub fn split_message(message: String, limit: i32) -> Vec<String> {
        let limit = limit as usize;

        // Helper function to calculate suffix length
        let get_suff_len = |a: usize, b: usize| format!("<{}/{}>", a, b).len();

        // Variables to determine the number of parts
        let mut num_parts = 0;
        let mut prefix_length_so_far = 0;

        // Find the number of parts required
        while 3 + (num_parts.to_string().len() * 2) < limit &&
              (num_parts * limit)
              - prefix_length_so_far
              - (num_parts * (3 + num_parts.to_string().len()))
              < message.len()
        {
            num_parts += 1;
            prefix_length_so_far += num_parts.to_string().len();
        }

        // Check if we have enough capacity for the message
        if (num_parts * limit)
            - prefix_length_so_far
            - (num_parts * (3 + num_parts.to_string().len()))
            < message.len()
        {
            return vec![];
        }

        // Construct the resulting parts
        let mut result = Vec::new();
        let mut l = 0;
        for i in 1..=num_parts {
            let data_length = limit - get_suff_len(i, num_parts);
            let end = (l + data_length).min(message.len());
            let token = format!("{}<{}/{}>", &message[l..end], i, num_parts);
            l += data_length;
            result.push(token);
        }

        result
    }
}

```
['String', 'Binary Search', 'Rust']