79630009

Date: 2025-05-20 07:55:16
Score: 0.5
Natty:
Report link

@julien edits for @salt solution

def explode_string(array):
    original_text = array[0][0]
    num_sublists = len(array)
    
    words = original_text.split()
    
    words_per_sublist, extras = divmod(len(words), num_sublists)
    
    result = []
    start_idx = 0
    
    for i in range(num_sublists):
        current_words = words_per_sublist + (1 if i < extras else 0)
        end_idx = start_idx + current_words
        
        sublist_text = " ".join(words[start_idx:end_idx])
        result.append([sublist_text])
        
        start_idx = end_idx
    
    return result

original_array = [
    ["Hi, this is Tesa form the sales departmet. Iam working here from"],
    [""],
    [""]
]
result = explode_string(original_array)
print(result)
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @julien
  • User mentioned (0): @salt
  • Self-answer (0.5):
  • Looks like a comment (1):
  • High reputation (-1):
Posted by: Bhargav