Re: techbayarea.us Abridged summary of leetcode-meetup@googlegroups.com - 4 updates in 1 topic

28 views
Skip to first unread message

Gowrima

unread,
May 22, 2021, 10:57:25 AM5/22/21
to leetcod...@googlegroups.com
1464 Maximum Product of Two Elements in an Array

class Solution:
    def maxProduct(self, nums: List[int]) -> int:
       
        l = len(nums)
       
        nums = sorted(nums)
       
        return (nums[l-1]-1)*(nums[l-2]-1)

Best,
gowrima

On Sat, May 22, 2021 at 1:32 AM <leetcod...@googlegroups.com> wrote:
"daryl...@gmail.com" <daryl...@gmail.com>: May 21 10:35PM -0700

1464 Maximum Product of Two Elements in an Array
<https://leetcode.com/problems/maximum-product-of-two-elements-in-an-array>
77.0% Easy
 
This would be a more difficult problem if we had to ...more
"daryl...@gmail.com" <daryl...@gmail.com>: May 21 11:08PM -0700

1504 Count Submatrices With All Ones
<https://leetcode.com/problems/count-submatrices-with-all-ones> 60.5%
Medium
 
This is honestly tricky for a medium problem, and more difficult than the ...more
"daryl...@gmail.com" <daryl...@gmail.com>: May 21 11:23PM -0700

1478 Allocate Mailboxes <https://leetcode.com/problems/allocate-mailboxes>
54.0% Hard
 
The main trick to this problem is figuring out where to place a mailbox
when there's only one mailbox. ...more
"alex...@gmail.com" <alex...@gmail.com>: May 21 11:27PM -0700

1504 Count Submatrices With All Ones
<https://leetcode.com/problems/count-submatrices-with-all-ones> 60.5%
Medium
class Solution:
def numSubmat(self, mat: List[List[int]]) -> int: ...more
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to leetcode-meet...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages