Should the return type be "vector<vector<string>>", instead of "vector<string>" ?


  • 0
    Y

    On solution is of type "vector<string>", and all solutions should be "vector<vector<string>>", isn't it?


  • 0
    S

    Here is the sample provided in problem description.

    A solution is ["cats and dog", "cat sand dog"].
    

    It does return vector<string>. Every string is then original s added some spaces, which indicates how the words in dictionary connect.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.