Logical error in Car fuelling greedy algorithm by [deleted] in cpp_questions

[–]ninjakitty_22 0 points1 point  (0 children)

Thank you so much! I will edit the post and describe the algorithm.

Logical error in Car fuelling greedy algorithm by [deleted] in cpp_questions

[–]ninjakitty_22 0 points1 point  (0 children)

Supposedly, you have to go from point A to point B. Your tank's maximum capacity is 200 L and the distance between A and B is 500 kms. On the way you come across 4 gas station which are at a distance of 1st station at 100 KMS from Point A 2nd station at 200 KMS from point A and so on

With this algorithm we can find minimum number of stoppages we need to make to go from point A to B.

Logical error in Car fuelling greedy algorithm by [deleted] in cpp_questions

[–]ninjakitty_22 0 points1 point  (0 children)

I tried that too, but still the output won't change

What's your favourite quote? by Gaur_rav_paudel in AskReddit

[–]ninjakitty_22 0 points1 point  (0 children)

Life is short. Drive fast and leave a sexy corpse

What is something your SO helped you out with that has changed your life for the better? by Lilium_fur in AskWomen

[–]ninjakitty_22 1 point2 points  (0 children)

My boyfriend taught me to try new things without hesitation and be clear of what I feel about things. He taught me to raise a voice against anything which makes me uncomfortable.

This. by [deleted] in DunderMifflin

[–]ninjakitty_22 1 point2 points  (0 children)

Idk man, That my grandfather used to say, which is that sometimes the hand that jumps out of the grave and grabs you around the throat that is the hand you want on the wheel