Below code obtaining right output but not matching the test cases, don’t know why ??
Please Check the code for the above problem!
hello @piyushkumar999999 i have corrected your code :
https://ide.codingblocks.com/s/369244 the problem was that you were taking input in the wrong format .
and in the loop where you hvae to do final work there also you were doing wrong way .
if you dont understand you can ask here .
Please explain the for loop and all that changes you have done in this problem sir .
see first of all the way in which you were takin input was wrong because you have to insert directly in the pair but you were first making array start ad taking all inputs in it and then doing the same for end as well .
more than that you count should start with 1 because you have selected the first activity and according to it you are going to compare the end time from the second input onwards .
in any input there is possibility that you dont find the result in the continous pattern for that you have used the last variable to update with the position of the last activity which you have selected .
these are all errors in your code :
if you still have any error you can ask here .
Happy Learning !!
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.