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 decodeString(self, s): | |
""" | |
s = "3[a]2[bc]", return "aaabcbc". | |
s = "3[a2[c]]", return "accaccacc". | |
s = "2[abc]3[cd]ef", return "abcabccdcdcdef". | |
""" | |
stack = []; coeff = 0; ans = '' | |
for c in s: |
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
func climbStairs(n int) int { | |
memo := map[int]int{ | |
1:1, | |
2:2, | |
} | |
var climb func(n int) int | |
climb = func (n int) int { | |
_, ok := memo[n]; | |
if !ok { |
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
<style> | |
:root{ | |
--main: hsl(230, 44%, 55%); | |
--secondary: hsl(230, 44%, 55%) | |
} | |
body{ | |
background-color: var(--main) | |
} | |
html{ |
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 defaultdict | |
class Graph: | |
def __init__(self): | |
self.nodes = set() | |
self.edges = defaultdict(list) | |
self.distances = {} | |
def add_node(self, value): |
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 fuzzywuzzy import process, fuzz | |
def match_by_fuzzy_string_search( | |
possible_matches: List[str], string_to_be_searched: str | |
) -> str: | |
scores = dict() | |
for candidate in possible_matches: | |
n = len(candidate.split()) | |
n_grams = generate_ngrams(string_to_be_searched, 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
#include < stdio.h > | |
#include "boards.h" | |
#include "app_util_platform.h" | |
#include "app_uart.h" | |
#include "app_error.h" | |
#include "nrf_drv_twi.h" | |
#include "nrf_delay.h" | |
#include "main.h" | |
/* Define version of GCC. */ |
NewerOlder