Super macha Nuvvu Cheppinatte 15min varaku Aalochincha Vocchindi,Thank You so much Macha✌🙏🙏 m=-1 for i in range(len(nums)): for j in range(i+1,len(nums)): if nums[i]
Brother if you dont mid Meeru python with dsa enni days lo course complete chedham ani anikuntunaru I know flow lo velthunaru ani, but just estimattion like 100 days / 50 days cheppagalaru Thank you so much for providing such a wonderful teaching providing to us Telugu community really needs a gem like you
optimized way for i in range(len(nums)): if nums[i] > min_value: max_diff = max(max_diff,nums[i]-min_value) min_value = min(min_value,nums[i]) return max_diff
n=len(nums) maximum_difference=-1 for i in range(n-1,-1,-1): for j in range(n): if i > j : difference = nums[i] - nums[j] if (difference > 0 and difference > maximum_difference) : maximum_difference= difference return maximum_difference
class Solution: def maximumDifference(self, nums: List[int]) -> int: diff=float("-inf") m=nums[0] for i in range(1,len(nums)): diff =max(diff,nums[i]-m) m=min(m,nums[i]) if diff
class Solution: def maximumDifference(self, nums: List[int]) -> int: s = nums[0] md = 0 for i in range(1,len(nums)): if nums[i] < s: s = nums[i] cd = nums[i] - s md = max(cd , md) if md == 0 : return -1 return md
class Solution: def maximumDifference(self, nums: List[int]) -> int: a=-1 n=len(nums) for i in range(n): for j in range(i+1,n): if nums[j]==nums[i]: pass else: a=max(a,nums[j]-nums[i]) return a
class Solution(object): def maximumDifference(self, nums): n=len(nums) maxi=-1 mini=nums[0] for i in range(1,n): if nums[i]>mini: diff=nums[i]-mini maxi=max(maxi,diff) else: mini=min(min,nums[i]) return maxi
Enti macha rojuuu oke Tshirt vesukuntunnav
Anyways baga cheputhunnav chala easy ga ardam avuthundi
❤❤❤❤thank you so much
Super macha Nuvvu Cheppinatte 15min varaku Aalochincha Vocchindi,Thank You so much Macha✌🙏🙏
m=-1
for i in range(len(nums)):
for j in range(i+1,len(nums)):
if nums[i]
Brother if you dont mid
Meeru python with dsa enni days lo course complete chedham ani anikuntunaru
I know flow lo velthunaru ani, but just estimattion like 100 days / 50 days cheppagalaru
Thank you so much for providing such a wonderful teaching providing to us
Telugu community really needs a gem like you
Videos full chusa macha Explanation chala bagundi macha ❤❤
Thankyou macha for your constant support
@@engineeringanimuthyam definitely machaa nenu ninnu ilane support chesthanu machaa nuvvu kuda maa andariki illane inka manchi manchi dsa videos chey machaa
Thanks a lot macha ❤️❤️❤️
@@karthikphotoeditz5645 sure macha Thankyou
def maximumDifference(self, nums: List[int]) -> int:
n=len(nums)
max_f=-1
i=0
for j in range(1,n):
if nums[i]
Ewww nice macha
optimized way
for i in range(len(nums)):
if nums[i] > min_value:
max_diff = max(max_diff,nums[i]-min_value)
min_value = min(min_value,nums[i])
return max_diff
n=len(nums)
maximum_difference=-1
for i in range(n-1,-1,-1):
for j in range(n):
if i > j :
difference = nums[i] - nums[j]
if (difference > 0 and difference > maximum_difference) :
maximum_difference= difference
return maximum_difference
video length increase chey bro
if ans == 0:
return -1
return ans
🙂
class Solution:
def maximumDifference(self, nums: List[int]) -> int:
n=len(nums)
ans= -1
for i in range(1,n-1):
if nums[i]
bro i did this problem in o(n)
class Solution:
def maximumDifference(self, nums: List[int]) -> int:
diff=float("-inf")
m=nums[0]
for i in range(1,len(nums)):
diff =max(diff,nums[i]-m)
m=min(m,nums[i])
if diff
class Solution:
def maximumDifference(self, nums: List[int]) -> int:
s = nums[0]
md = 0
for i in range(1,len(nums)):
if nums[i] < s:
s = nums[i]
cd = nums[i] - s
md = max(cd , md)
if md == 0 :
return -1
return md
bro ads konchem tagginchu bro mari ekkuva vosthu vunnay prathi video ki (rendu vostunnay)
Bro daily konchem ekkuva topics cheppu bro chala lag ga unnattu undhi
Bro Dsa with python ante... Python mundhe nerchukoni undala??
Yes
Avasaram ledu Bro from scratch nundi untadi chudu edhi
class Solution:
def maximumDifference(self, nums: List[int]) -> int:
a=-1
n=len(nums)
for i in range(n):
for j in range(i+1,n):
if nums[j]==nums[i]:
pass
else:
a=max(a,nums[j]-nums[i])
return a
class Solution(object):
def maximumDifference(self, nums):
n=len(nums)
maxi=-1
mini=nums[0]
for i in range(1,n):
if nums[i]>mini:
diff=nums[i]-mini
maxi=max(maxi,diff)
else:
mini=min(min,nums[i])
return maxi