WTF ! COUT and RETURN ARE DIFFERENT LOL

programming
Tags: #<Tag:0x00007f24268839b0>

#1

expected output was 2
my function return 1
but when i test custom input printing value using cout
it returned
2 from cout
2 from return
wtf the fk is happpening this platform sus


#2

same happening with me bro. Not only in this ques but in some other ques too.


#3

you might have declared some global variables and might be using them. Make sure to reset them in beginning of your function. It is possible there are multiple test cases running and that’s why you get incorrect answers.