#algorithms
Read more stories on Hashnode
Articles with this tag
Problem Link class Solution: def getPermutation(self, n: int, k: int) -> str: fact = [1] * (n+1) for i in range(2, n+1): ...
Problem Link Solution 1: DFS class Solution: def lastStoneWeightII(self, stones: List[int]) -> int: memo = dict() return...
Problem Link class Solution: def nthUglyNumber(self, n: int, a: int, b: int, c: int) -> int: left = 1 right = 2 * 10**9 ...
Problem Link class Solution: def openLock(self, deadends: List[str], target: str) -> int: # Find the shortest path: BFS if '0000'...
Problem Link class Solution: def canPlaceFlowers(self, flowerbed: List[int], n: int) -> bool: cnt = 0 pre = 0 for i in...
Problem Link Solution 1 class Solution: def findCircleNum(self, isConnected: List[List[int]]) -> int: res = 0 for i in...