DL
(map
(partial gen-string-ids id) (gen-ids amount))
Size: a a a
DL
(map
(partial gen-string-ids id) (gen-ids amount))
T
(str id "_" index)
никто не мешает потом генерить на фронте, а в кишках держать мапкуT
(defn vehicle-names [{:keys [id amount]}]
(let [prefix (str id "_")
indices (range 1 (inc amount))]
(map #(str prefix %) indices)))
DL
(defn vehicle-names [{:keys [id amount]}]
(let [prefix (str id "_")
indices (range 1 (inc amount))]
(map #(str prefix %) indices)))
DL
T
MK
[:a
:b
{:c [:d {:e [:f]}]
:g :h}]
#{[:a]
[:b]
[:c :d]
[:c :e :f]
[:g :h]}
T
[:a
:b
{:c [:d {:e [:f]}]
:g :h}]
#{[:a]
[:b]
[:c :d]
[:c :e :f]
[:g :h]}
[:a
:b
{:c [:d
{:e [:f
{:i :j}]}]
:g :h}]
Будет=> #{[:a]?
[:b]
[:c :d]
[:c :e :f]
[:c :e :i :j]
[:g :h]}
MK
[:a
:b
{:c [:d
{:e [:f
{:i :j}]}]
:g :h}]
Будет=> #{[:a]?
[:b]
[:c :d]
[:c :e :f]
[:c :e :i :j]
[:g :h]}
T
ИС
[:a
:b
{:c [:d {:e [:f]}]
:g :h}]
#{[:a]
[:b]
[:c :d]
[:c :e :f]
[:g :h]}
IG
T
T
MK
MP
IG
(reduce (fn [acc i]
(if (empty? acc)
(conj acc [i])
(conj acc (conj (peek acc) i))))
[]
[1 2 3 4 5])
IG
IG
[[1] [1 2] [1 2 3] [1 2 3 4] [1 2 3 4 5]]