Day 5: Introduction to Correlation

Sort 9 Discussions, By:

Sorry, you do not have a permission to answer to this question.

  • SalvadorDali 9 years ago + 2 comments

    It is unimaginably sad to see such elementary task with a mistake... Hackerrank employers please verify your answers before creating a competition.

    Add Reply Preview cancel

    Sorry, you do not have a permission to answer to this question.

    • mschle 9 years ago + 1 comment

      I'm pretty sure I entered the correct answer, yet it gets rejected, what's the problem?

      Add Reply Preview cancel

      Sorry, you do not have a permission to answer to this question.

      • SalvadorDali 9 years ago + 1 comment

        I think I explained it clearly. Solution that hackarrank think is correct, is actually wrong.

        Add Reply Preview cancel

        Sorry, you do not have a permission to answer to this question.

        • mschle 9 years ago + 0 comments

          I can see that, but why doesn't it get fixed?

          Add Reply Preview cancel

          Sorry, you do not have a permission to answer to this question.

      • Siarhei_Karavai 9 years ago + 1 comment

        I do not know, which answer it accepts, but I'm pretty sure, that I've calculated coeffcients correctly and my answer is marked as wrong.

        Add Reply Preview cancel

        Sorry, you do not have a permission to answer to this question.

        • Siarhei_Karavai 9 years ago + 0 comments

          Ok, I got it. Incorrect rounding.

          Add Reply Preview cancel

          Sorry, you do not have a permission to answer to this question.

      • mschle 9 years ago + 0 comments

        As someone who solved it: there is a rounding error in the Pearson correlation. Enter a number 0.001 higher than you expect and it will work. Strange however that you can enter a correct Spearman coefficient and an incorrect Pearson correlation coefficient getting zero points.

        Add Reply Preview cancel

        Sorry, you do not have a permission to answer to this question.

        • ba205 9 years ago + 0 comments

          My code is correct, but I got a runtime error at 0.01 seconds, so I just ran it on my own computer and printed the results I got from there here. Why would this happen?

          Add Reply Preview cancel

          Sorry, you do not have a permission to answer to this question.

          • roush95 9 years ago + 0 comments

            For calculatins spearman's rank constant, both the datas are already sorted. So, difference in ranks comes 0 for all values. In that case spearsman constant should be 1 ?

            Add Reply Preview cancel

            Sorry, you do not have a permission to answer to this question.

            • PRASHANTB1984 Challenge Author 9 years ago + 0 comments

              @SalvadorDali @Mschle @hermes_jr @Sergey_Karavay - tolerance for rounding has been re-included now. Deleting a thread which now has a comment with the solution in it though.

              Add Reply Preview cancel

              Sorry, you do not have a permission to answer to this question.

              1. Challenge Walkthrough
                Let's walk through this sample challenge and explore the features of the code editor.1 of 6
              2. Review the problem statement
                Each challenge has a problem statement that includes sample inputs and outputs. Some challenges include additional information to help you out.2 of 6
              3. Choose a language
                Select the language you wish to use to solve this challenge.3 of 6
              4. Enter your code
                Code your solution in our custom editor or code in your own environment and upload your solution as a file.4 of 6
              5. Test your code
                You can compile your code and test it for errors and accuracy before submitting.5 of 6
              6. Submit to see results
                When you're ready, submit your solution! Remember, you can go back and refine your code anytime.6 of 6
              1. Check your score