Do:
1.We Have one Array the Problem is to Print Minimum Difference Between its elements
Input: 5
1 20 31 5 7
Input: 5
1 20 31 5 7
Output: 2
{post your program in comment box ↓}2.Know about the Linked List Datastructure.
https://www.geeksforgeeks.org/data-structures/linked-list/
3.Know about the Process Synchronization.
------------------------------------------------------------------------------Learn:
0)Meaning : Derogate
--to take away a part so as to impair
1)Idiom : A penny for your thoughts
--A way of asking what someone is thinking
--A way of asking what someone is thinking
2)GroupDisc: Ethics or Profit
{post your view in comment box↓}
------------------------------------------------------------------------------
------------------------------------------------------------------------------
HealthTips: DO THE FIVE
--------Help stop coronavirus
1.Hands ---Wash then often
2.Elbow ---cough into it
3.Face ----Don't touch it
4.Space ---Keep safe distance
5.Feel sick?---Stay home by consult specialist
STAY HOME ,BE SAFE
---YOUR BRIGHT FUTURE WAITING FOR YOU
------------------------------------------------------------------------------
STAY HOME ,BE SAFE
---YOUR BRIGHT FUTURE WAITING FOR YOU
------------------------------------------------------------------------------
Motivation For The Day
"Well done is better than well said"
Note:
We Are Providing Every Content in this Blog Inspired From Many People and Provide it Open To All People Who Are Willing Gain Some Stuff in Computer Science.
5 Comments
d = 10000
ReplyDeletefor i in range(n-1):
for j in range(i+1,n):
if abs(a[i]-a[j]) < d:
d = abs(a[i] - a[j])
return d
//the above code takes more time complexity,for that we can just sort and do the same
GD: Its obviously Ethics
good thank you for support..
DeleteEleborate the GD topic more in a paragraph.
Ethics are really important in every ones life.one day or other we can earn money but not ethics and morals .World is in this position due to lack of ethics. Every person is thinking about himself or herself but not others,thats why rich people are becoming richer and poor more poorer.We should have ethics by birth...it is not something which we can gain by learning .
DeleteThis comment has been removed by the author.
ReplyDeletel=list(map(int,input().split()))
ReplyDeletel.sort()
l1=[abs(l[i]-l[i+1]) for i in range(len(l)-1)]
print(min(l1))
#this can be done by O(nlogn)
Post a Comment
Learn, Share and Enjoy