We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
@hariharan90000
Had the same doubt seeing the above comments but no one mentioned why and i couldn't find any logic to that arguement.
It can be
There is nothing wrong with our M-x becoming -ive cause in the original question we are adding values to nos. so they can never be negative.It is just to make our compress our question we are subtracting and getting -ive values and so it won't affect the original problem.
Consider the eg:
1 4 4
M=1
if x = 0 M-x = 1
ans = 4
if x = 1 M-x = 0
ans = 4
if x = 2 M-x = -1
ans = 3 ( 1 4 4 1 6 6 6 6 11 11 11 11)
that's lesser than wat we would get for M-x>=0
Plz Correct me if i'm wrong.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Equal
You are viewing a single comment's thread. Return to all comments →
@hariharan90000 Had the same doubt seeing the above comments but no one mentioned why and i couldn't find any logic to that arguement.
It can be
There is nothing wrong with our M-x becoming -ive cause in the original question we are adding values to nos. so they can never be negative.It is just to make our compress our question we are subtracting and getting -ive values and so it won't affect the original problem.
Consider the eg:
1 4 4
M=1 if x = 0 M-x = 1 ans = 4
if x = 1 M-x = 0 ans = 4
if x = 2 M-x = -1 ans = 3 ( 1 4 4 1 6 6 6 6 11 11 11 11)
that's lesser than wat we would get for M-x>=0
Plz Correct me if i'm wrong.