• + 0 comments

    Simplest Way To Do It !! string canConstruct(vector a) { // Return "Yes" or "No" denoting whether you can construct the required number. int n = a.size(); long sum = 0;

    for(int i = 0 ; i< n; i++)
    {
        sum += a[i];
    }
    if(sum % 3== 0) return "Yes";
    else return "No";
    

    }