Sort by

recency

|

138 Discussions

|

  • + 0 comments

    template int reversed_binary_value() { vector v {binary...}; int size = v.size(); int sum{}; for(int i=0; i

  • + 0 comments

    Here is C++ Variadics problem solution - https://programmingoneonone.com/hackerrank-cpp-variadics-solution.html

  • + 0 comments

    Hours later, I still can understand how reversed_binary_value() function contributes towards getting the desired string output!!!!

    I wonder if the author also understands what he wrote as a challenge.

  • + 0 comments

    Once I understood what it was all about I came up with this:

    template <bool...digits>
    int reversed_binary_value() {
        vector<bool> values{digits...};
        int sum = 0;
        for(int i{0};i < values.size(); ++i)
            sum += ((1&values[i])<<i);
        return sum;
    }
    
  • + 0 comments

    By this practice and the following answers, now I remeber again some topics that for a while, I forgot them. Thanks everybody for the solutions.