Avoid creating std::vector, and use single instead of double traversal.
Attach a file by drag & drop or click to upload