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
import java.util.Scanner; | |
/* | |
* Create the Encrypter class here. | |
*/ | |
class Encrypter { | |
public static String getEncryptedName(String name) { | |
// if (name != null){ | |
Validator myValidator = new Validator(); |
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 last_element(list_of_values): | |
return list_of_values[len(list_of_values) - 1] if list_of_values else None |
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
# Base case where at least one string is empty | |
def deletion_distance_base(str1, str2): | |
deletions = 0 | |
if len(str1) == 0 or len(str2) == 0: | |
return max(len(str1), len(str2)) + deletions | |
def deletion_distance_recursive(str1, str2): | |
if len(str1) == 0 or len(str2) == 0: |
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 generateMatrix(self, n): | |
""" | |
:type n: int | |
:rtype: List[List[int]] | |
""" | |
if n <= 0: | |
return [] | |
matrix = [[0]*n for _ in xrange(n)] |
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
{ | |
"_id": "aZ9TU0M8C", | |
"containers": [ | |
{ | |
"_id": "cJO1MLH1N", | |
"name": "blah", | |
"size": 4 | |
}, | |
{ | |
"_id": "cBCXCOPV5", |
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
{ | |
"_id": "aZ9TU0M8C", | |
"containers": [ | |
{ | |
"_id": "cJO1MLH1N", | |
"name": "blah", | |
"size": 4 | |
}, | |
{ | |
"_id": "cBCXCOPV5", |
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
{ | |
"_deleted": true, | |
"containers": [ | |
{ | |
"id": "string", | |
"name": "string", | |
"size": "string" | |
} | |
], |
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 updateBoard(self, board: List[List[str]], click: List[int]) -> List[List[str]]: | |
self.board = board | |
def dfs(i, j): | |
if i < 0 or j < 0 or i == len(board) or j == len(board[i]): | |
return | |
if self.board[i][j] not in ['E', 'M']: | |
return | |
if self.board[i][j] == 'M': | |
self.board[i][j] = 'X' |
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 findDuplicateSubtrees(self, root): | |
def trv(root): | |
if not root: return "null" | |
struct = "%s,%s,%s" % (str(root.val), trv(root.left), trv(root.right)) | |
nodes[struct].append(root) | |
return struct | |
nodes = collections.defaultdict(list) | |
trv(root) | |
return [nodes[struct][0] for struct in nodes if len(nodes[struct]) > 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
yarn add v1.13.0 | |
warning package.json: No license field | |
info No lockfile found. | |
warning No license field | |
[1/4] Resolving packages... | |
[2/4] Fetching packages... | |
[3/4] Linking dependencies... | |
[4/4] Building fresh packages... | |
success Saved lockfile. | |
warning No license field |
NewerOlder