docker ps
docker inspect [container-id]
docker images
#https://leetcode.com/explore/challenge/card/30-day-leetcoding-challenge/529/week-2/3297/ | |
class Solution(object): | |
def lastStoneWeight(self, stones): | |
""" | |
:type stones: List[int] | |
:rtype: int | |
""" | |
while len(stones) > 1: | |
stones.sort() | |
new_value = stones.pop() - stones.pop() |
class Solution(object): | |
def backspaceCompare(self, S, T): | |
""" | |
:type S: str | |
:type T: str | |
:rtype: bool | |
""" | |
def deleteBackspace(word): | |
temporal = [] |
#https://leetcode.com/explore/challenge/card/30-day-leetcoding-challenge/529/week-2/3290/ | |
class Solution(object): | |
def middleNode(self, head): | |
""" | |
:type head: ListNode | |
:rtype: ListNode | |
""" | |
middle = head |
class Solution(object): | |
def countElements(self, arr): | |
""" | |
:type arr: List[int] | |
:rtype: int | |
""" | |
result = 0 | |
for j in arr: |
#https://leetcode.com/explore/challenge/card/30-day-leetcoding-challenge/528/week-1/3288/ | |
class Solution(object): | |
def groupAnagrams(self, strs): | |
""" | |
:type strs: List[str] | |
:rtype: List[List[str]] | |
""" | |
keys = {} | |
result = [] |
class Solution(object): | |
def moveZeroes(self, nums): | |
""" | |
:type nums: List[int] | |
:rtype: None Do not return anything, modify nums in-place instead. | |
""" | |
count = 0 | |
for i, num in enumerate(nums): | |
if num == 0: |
# https://leetcode.com/explore/featured/card/30-day-leetcoding-challenge/528/week-1/3285/ | |
def maxSubArray(self, nums): | |
""" | |
:type nums: List[int] | |
:rtype: int | |
""" | |
maximum = nums[0] | |
current = 0 | |
for i in range(len(nums)): |
#https://leetcode.com/explore/featured/card/30-day-leetcoding-challenge/528/week-1/3284/ | |
class Solution(object): | |
def isHappy(self, n): | |
""" | |
:type n: int | |
:rtype: bool | |
""" | |
exists = set() | |
while n != 1: |
#https://leetcode.com/explore/challenge/card/30-day-leetcoding-challenge/528/week-1/3283/ | |
class Solution: | |
def singleNumber(self, nums: List[int]) -> int: | |
nums.sort() | |
found = 0 | |
for i in nums: | |
if nums.count(i) == 1: | |
found = i | |
return found |