+ 2
my solution is not giving correct output on hacker but giving correct output on my pc.
link of the question... i know my code is a mess https://www.hackerrank.com/challenges/climbing-the-leaderboard/problem https://code.sololearn.com/c49i4K5x7Q4y/? ref=app
4 Respuestas
+ 3
Have you compiled with all warnings set?
I often compile as follows:
g++ -Wall fred.cpp
Which gives warnings.
+ 2
Also, did you copy their code, and just enter your code where it says? They will have some kind of validation code that requires the code is a certain structure.
They'll probably run a test dataset through the function climbingLeaderboard(), and check the vector object that is returned.
+ 1
I've just completed this problem. You need to take all the code from Hacker Rank, and just add to the function where it says "Add code here".
You're better off using vectors for this, in my opinion. If you add Alice's score to a copy of the score list, then remove duplicates, then reverse sort it, you just need to then find the index of her score, and add one to it. Then repeat for all her scores.
0
Xan i did lots of questions with my own code...but this is doing something wierd ..you can even run this code in sololearn, running completely okay