ENGINE | Contact |
---|---|
360 | [email protected] |
Abusix | [email protected], https://lookup.abusix.com/ |
Acronis | [email protected] |
ADMINUSLabs | [email protected], [email protected], [email protected] |
AegisLab | [email protected] |
Ahnlab | [email protected], [email protected] |
AILabs (Monitorapp) | [email protected] |
Alibaba | [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution: | |
def twoSum(self, nums: List[int], target: int) -> List[int]: | |
seen = {} | |
for idx,num in enumerate(nums): | |
req = target - num | |
if req in seen: | |
return [seen[req], idx] | |
seen[num] = idx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
v = 0 # global variable | |
def a(): | |
def test(n): | |
nonlocal m # used in nested function whose local scope is not defined | |
global v # outside of function or in global scope | |
if n == 5: | |
return n | |
t = test(n + 1) # local variable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def isUnival(root, val): | |
if root is None: | |
return True | |
if root.val != val: | |
return False | |
left = isUnival(root.left, val) | |
right = isUnival(root.right, val) | |
if not left or not right: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s = " hello bangladesh" | |
li = [] | |
startIdx = 0 | |
for i in range(len(s)): | |
if s[i] == " " and s[startIdx] != " ": | |
li.append(s[startIdx : i]) | |
startIdx = i | |
elif s[startIdx] == " ": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const arr = [ | |
1, | |
[2], | |
[[3]], | |
[[[4]]], | |
[5], | |
[[[[[[[[[[[[7]]]]]]]], 1]]]], | |
7, | |
[[[10], [[[[[[[[1]]]]]]]]]], | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution: | |
def solveNQueens(self, n: int) -> List[List[str]]: | |
res = [] | |
def canPlace(board, n, row, col): | |
# col | |
for i in range(row): | |
if board[i][col]: | |
return False | |
# left diagonal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import Counter | |
from heapq import heappush, heappop, heappushpop | |
class Item(object): | |
def __init__(self, word, freq): | |
self.word = word | |
self.freq = freq | |
def __lt__(self, other): | |
if self.freq == other.freq: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const arr = [1,5,2,9,7,6] | |
/** | |
1 5 9 7 2 6 | |
l = 1 | |
r = 4 | |
1,5,2,9,7,6 | |
2 odd ? l++ | |
2 even ? r-- | |
else : l |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
"41234" | |
one thousand, two hundred and thirty four | |
last 2 digits | |
44 = fourty + four | |
34 = thirty + four | |
24 = twinty + four | |
NewerOlder