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.
List has std::initializer_list type. Just add iteration (standard iterators, begin() and end()), some binary manipulation and you will get result. It took me 2 lines of code more.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
C++ Variadics
You are viewing a single comment's thread. Return to all comments →
There is simpler way:
List has std::initializer_list type. Just add iteration (standard iterators, begin() and end()), some binary manipulation and you will get result. It took me 2 lines of code more.