我有像這樣的字符串列表。字符串解析到數組的最佳算法
"Section 1/Part 1"
"Section 2/Part 1"
"Section 2/Part 2"
"Section 3/Part 1"
"Section 3/Part 2"
"Section 3/Part 3"
我要分析它的數組列表中的數組列表如下:
Section 1 -> Part 1
Section 2 -> Part 1
-> Part 2
Section 3 -> Part 1
-> Part 2
-> Part 3
一個簡單的代碼示例,請於理解算法
用'/'分割,然後根據第一項進行分類。你的編程語言是什麼? – Kasramvd
我已經把它分開了。我想用它創建數組 –
你嘗試了什麼? – Winter