I am getting wrong answer in MAXIMUM CICLE PROBLEM IN GREEDY

Reply as early as possible

Hello @sunneykumar309
print n-sum in place of sum.

still i am getting error

what error u r getting?

Run Error
;;;;;;;;;;;;;;;;;;;;;;;;;;

image

increase ur size of array it should be atleast 10^5

bhaiya ab wrong answer aa rha hai

. …

also remove additional cout statements

1 Like

ok bhaiya…

Which is the site is best for practicing greedy,dp questions?

leetcode
… … …

after completing the greedy lectures .I am unable to solve q on greedy?
What should i do.

practice is the only thing u can do.
for that u can either use gfg or leetcode
both r good.

if i stuck in any problem , then how much time i should give on to that q

if u r in first or second year then try to give complete day (no issue in that u will never forget whatever problemu will solve on ur own) .
if u r in 3rd year then i think 1/1.5 is sufficient to think for solution.

also make sure u dont skip questions that u r not able to solve.
make it a habit to solve atleast one new problem (problem that u dont know how to solve) daily.

1 Like

Thankx Bhaiya…

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.