We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
If you don't want to use std::vector here, you can use std::array instead, not C-style arrays.
And no, std::vector is not 'much more heavier'. It depends on how you use it (i.e. if you do a lot of reallocations). In my code, there is only one allocation since I provide the size at the initialization.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Arrays Introduction
You are viewing a single comment's thread. Return to all comments →
If you don't want to use std::vector here, you can use std::array instead, not C-style arrays.
And no, std::vector is not 'much more heavier'. It depends on how you use it (i.e. if you do a lot of reallocations). In my code, there is only one allocation since I provide the size at the initialization.