Sort by

recency

|

6065 Discussions

|

  • + 0 comments

    The "i don't type for free way"-

    return sum(v // 2 for v in counts.values())
    
  • + 0 comments

    There are two ways to solve this with Counter: The normal way-

    # result = 0
        # for a in ar.values():
        #     result += int(a/2)
        # return result
    
  • + 0 comments
    def sockMerchant(n, ar):
        arr=ar
        ans=[]
        arr=list(set(arr))
        for i in arr:
            ans.append(ar.count(i)//2)
        return sum(ans)
    
  • + 0 comments

    Python

    def count_elements(n, arr):
        pairs = 0
        count = 0
        for x in arr:
            if n == x:
                count += 1
            if count == 2:
                pairs += 1
                count = 0
        return pairs
    
    def sockMerchant(n, ar):
        count = 0
        numbers = set()
        [numbers.add(x) for x in ar]
        for x in numbers:
            count += count_elements(x, ar)
        return count
    
  • + 1 comment

    While discussing strategies to maximize efficiency in Sales by Match, it’s worth considering how outsourcing certain sales functions can impact overall performance. For businesses looking to scale quickly or tap into specialized expertise, Sales Outsourcing Australia offers a way to handle lead generation, client follow-ups, and closing processes without overextending internal teams. Integrating outsourced support can complement in-house efforts, ensuring that matching supply and demand remains smooth while maintaining high conversion rates.