• Jul 2, 2025 •AustinLeath
0 likes • 1 view
import calendar from datetime import datetime # Get the UTC timestamp a = calendar.timegm(datetime.utcnow().utctimetuple()) print(a)
• Oct 15, 2022 •CodeCatch
class Solution(object): def floodFill(self, image, sr, sc, newColor): R, C = len(image), len(image[0]) color = image[sr][sc] if color == newColor: return image def dfs(r, c): if image[r][c] == color: image[r][c] = newColor if r >= 1: dfs(r-1, c) if r+1 < R: dfs(r+1, c) if c >= 1: dfs(r, c-1) if c+1 < C: dfs(r, c+1) dfs(sr, sc) return image
• Sep 14, 2024 •rgannedo-6205
0 likes • 2 views
https://codecatch.net/post/06c9f5b7-1e00-40dc-b436-b8cccc4b69be
• Nov 19, 2022 •CodeCatch
from collections import defaultdict def collect_dictionary(obj): inv_obj = defaultdict(list) for key, value in obj.items(): inv_obj[value].append(key) return dict(inv_obj) ages = { 'Peter': 10, 'Isabel': 10, 'Anna': 9, } collect_dictionary(ages) # { 10: ['Peter', 'Isabel'], 9: ['Anna'] }
def key_of_min(d): return min(d, key = d.get) key_of_min({'a':4, 'b':0, 'c':13}) # b
• Oct 7, 2022 •KETRICK
import pandas as pd x = pd.read_excel(FILE_NAME) print(x)