Sort by

recency

|

3078 Discussions

|

  • + 0 comments

    the resolute in php function getTotalX(b) { a; sort(sb = sb); sb); i=1;mb;count); } function isperfect (a){ foreach(i => Extra close brace or missing open bracej,Extra open brace or missing close braceb as val){ if(j != 0 ){ return false; } } return true; }

  • + 0 comments

    Code in C#

    int count = 0; List factorsOfAarray = new(); int minimumb = b.Min(); for (int i = a.Max(); i <= minimumb; i++) { bool remainderOperator = true; foreach (var element in b) { if (element % i != 0) { remainderOperator = false; } } if (remainderOperator) { bool factorsOfinteger = true; foreach (var elementina in a) { if (i % elementina != 0) { factorsOfinteger = false; } } if (factorsOfinteger) { count += 1; } } }

    Console.WriteLine(count)

  • + 0 comments

    My JavaScript code is right and passes all tests, however its submission fails with error:

    We couldn't process your submission. Please subit your code again!

    I have tried to reset the code and copy back my portion of code, in vain. Submission always fails.

    HackerRank admins, please check and fix.

    Thanks.

  • + 0 comments
    int getTotalX(vector<int> a, vector<int> b) {
        // assume vectors are sorted and a_n <= b_1    
        int betweenCount = 0;
        
        for (int q = a.back(); q <= b.front(); q += a.back()) {
            bool isMultiple = std::all_of(a.begin(), a.end(),
                [q] (int el) { return q % el == 0; }); 
            bool isFactor = std::all_of(b.begin(), b.end(),
                [q] (int el) { return el % q == 0; });
            if (isMultiple && isFactor)
                betweenCount++;
        }
        
        return betweenCount;
    }
    
  • + 0 comments

    I’ve been exploring different problem-solving approaches lately, and just like finding the right logic in coding challenges, sometimes you also need the right experience in real life to enjoy things fully. For anyone planning an adventure, I recommend checking out The Dune Buggy Dubai Website – it’s a great place to discover thrilling dune buggy rides in the Dubai desert.