Hey Programmer, if you have any alternative solution feel free to post in comment section.
@prabhashkumar73995 жыл бұрын
Coding Cart close that clothing store🤣😂
@codingcart5 жыл бұрын
Will soon..
@shanekye35083 жыл бұрын
i dont mean to be so off topic but does anybody know of a trick to get back into an instagram account..? I was stupid lost the login password. I would appreciate any tips you can offer me
@aaditshah58253 жыл бұрын
Nice video bro keep it up :D! An alternate solution: def sockMerchant(n, array): pairs = 0 set_of_array = set(array) for i in set_of_array: count = array.count(i) total_pair = count//2 pairs += total_pair return pairs
@infinitygaming71923 жыл бұрын
my solution def sockMerchant(n, ar): cat = Counter(ar) c = list(cat.values()) d = 0 for i in range(0,len(c)): if c[i] > 1: d += int(c[i]/2) return(d) i am working very hard i wish i become programmer like you
@abhisheksaha39535 жыл бұрын
really helpful. was not aware of counter feature. thank you for sharing.👍
@sachinsingh-jg9lx5 жыл бұрын
Wow nice solsn
@prashnatdivase85234 жыл бұрын
Alternate solution blank_list=[] count_of_pair=0 for i in ar: if i not in blank_list: cnt= ar.count(i) count_of_pair+= cnt//2 blank_list.append(i) return count_of_pair
@prashnatdivase85234 жыл бұрын
Can someone try and confirm?
@codingcart4 жыл бұрын
You can submit, link for the problem is in description.
@prashnatdivase85234 жыл бұрын
@@codingcart sure
@gioadan4680 Жыл бұрын
My output keeps returning 2 instead of three and four for cases 1 and 2, what’s the reason for this?
@rahulrc79054 жыл бұрын
very well explained!!
@codingcart4 жыл бұрын
Glad it was helpful!
@harshhwardhanrai37164 жыл бұрын
I don't how how this question can be warmup challenge, dimaag hila daala is problem be to
@codingcart4 жыл бұрын
Hahaaha ..Keep calm dude
@Wonder_with_nature4 жыл бұрын
def pairlist(list): data = [] sum = 0 r = set(list) for i in r: res = list.count(i) data.append({i:res}) for j in data: for key, val in j.items(): result = val//2 sum = sum+result return sum
@RohanVemula4 жыл бұрын
Can't we solve by solving with arrays Like arr[i]=arr[i+1]