content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
def make_cmd_params(command, nodes, env, sourcehash): inputs = {} outputs = [] files = [] #to be monitored refs = [] output_refs = [] params = { "lineno": command["cmd"]["lineno"], "source": command["cmd"]["source"], "sourcehash": sourcehash, "refs": refs, ...
def make_cmd_params(command, nodes, env, sourcehash): inputs = {} outputs = [] files = [] refs = [] output_refs = [] params = {'lineno': command['cmd']['lineno'], 'source': command['cmd']['source'], 'sourcehash': sourcehash, 'refs': refs, 'output_refs': output_refs, 'inputs': inputs, 'outputs': ...
def marge(arr, start, mid, end): num1 = mid - start + 1 num2 = end - mid left = [0] * (num1) right = [0] * (num2) for i in range(0, num1): left[i] = arr[start+i] for j in range(0, num2): right[j] = arr[mid+1+j] i = 0 j = 0 k = start while i < num1 and j < num2:...
def marge(arr, start, mid, end): num1 = mid - start + 1 num2 = end - mid left = [0] * num1 right = [0] * num2 for i in range(0, num1): left[i] = arr[start + i] for j in range(0, num2): right[j] = arr[mid + 1 + j] i = 0 j = 0 k = start while i < num1 and j < num2: ...
#gas_flow_class class Gas(): def __init__(self) -> None: self.Pt = 0 self.Tt = 0 self.P = 0 self.T = 0 self.H = 0 self.S = 0 self.Cp = 1.005 self.f = 0 #fraction of air and gas self.mass = 0 #massflow self.c = 0 #velocity of gas in m/s ...
class Gas: def __init__(self) -> None: self.Pt = 0 self.Tt = 0 self.P = 0 self.T = 0 self.H = 0 self.S = 0 self.Cp = 1.005 self.f = 0 self.mass = 0 self.c = 0 self.a = 0 self.k = 1.33 self.Rg = 287 self....
# -*- coding: utf-8 -*- class B: print('B is imported')
class B: print('B is imported')
class Solution: def deckRevealedIncreasing(self, deck: List[int]) -> List[int]: n = len(deck) order = collections.deque(list(range(n))) m = [-1] * n cnt = 0 while order: idx = order.popleft() m[cnt] = idx cnt += 1 if order: ...
class Solution: def deck_revealed_increasing(self, deck: List[int]) -> List[int]: n = len(deck) order = collections.deque(list(range(n))) m = [-1] * n cnt = 0 while order: idx = order.popleft() m[cnt] = idx cnt += 1 if order: ...
def test_StrOp_concat(): s: str s = '3' + '4' s = "a " + "test" s = 'test' + 'test' + 'test'
def test__str_op_concat(): s: str s = '3' + '4' s = 'a ' + 'test' s = 'test' + 'test' + 'test'
''' Write a Min Max Stack class. The class should support pushing and popping values on and off the stack, peeking at values at the top of the stack, and getting both the minimum and maximum values in the stack. All class methods, when considered independently, should run in constant time and with constant space. Inpu...
""" Write a Min Max Stack class. The class should support pushing and popping values on and off the stack, peeking at values at the top of the stack, and getting both the minimum and maximum values in the stack. All class methods, when considered independently, should run in constant time and with constant space. Inpu...
def genres(items, excludedGenres): filteredGenres = [] for item in items: for genre in item["genres"]: if len(list(set(genre.split()).intersection(excludedGenres))) == 0: genre = genre.replace(' ', '-').lower() if not genre in filteredGenres: ...
def genres(items, excludedGenres): filtered_genres = [] for item in items: for genre in item['genres']: if len(list(set(genre.split()).intersection(excludedGenres))) == 0: genre = genre.replace(' ', '-').lower() if not genre in filteredGenres: ...
# # PySNMP MIB module SAVEPOWER-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/SAVEPOWER-MIB # Produced by pysmi-0.3.4 at Wed May 1 15:00:47 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 201...
(object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_union, constraints_intersection, value_size_constraint, single_value_constraint, value_range_constraint) ...
# encoding: utf-8 # Author: Kyohei Atarashi # License: MIT def _cd_linear_epoch(w, X, y, y_pred, col_norm_sq, alpha, loss, indices_feature): sum_viol = 0 n_samples = len(y) for j in indices_feature: update = 0 # compute gradient with respect to w_j for i in ran...
def _cd_linear_epoch(w, X, y, y_pred, col_norm_sq, alpha, loss, indices_feature): sum_viol = 0 n_samples = len(y) for j in indices_feature: update = 0 for i in range(n_samples): update += loss.dloss(y_pred[i], y[i]) * X[i, j] update += alpha * w[j] inv_step_size =...
symbol_1 = input() symbol_2 = input() string = input() total_sum = 0 for letter in string: if ord(symbol_1) < ord(letter) < ord(symbol_2): total_sum += ord(letter) print(total_sum)
symbol_1 = input() symbol_2 = input() string = input() total_sum = 0 for letter in string: if ord(symbol_1) < ord(letter) < ord(symbol_2): total_sum += ord(letter) print(total_sum)
def teardown_func(): assert 1 == 0 def test(): pass test.teardown = teardown_func
def teardown_func(): assert 1 == 0 def test(): pass test.teardown = teardown_func
class Note: def __init__(self, content: str): self.content = content
class Note: def __init__(self, content: str): self.content = content
def large_population(population): if(found > 2000): return True else: return False
def large_population(population): if found > 2000: return True else: return False
#!/usr/bin/python3 # -*- coding: utf-8 -*- default_date = '2021-03-10' default_rates = {'EUR': 1.0, 'USD': 1.1892, 'JPY': 129.12, 'BGN': 1.9558, 'CZK': 26.226, 'DKK': 7.4366, 'GBP': 0.85655, 'HUF': 367...
default_date = '2021-03-10' default_rates = {'EUR': 1.0, 'USD': 1.1892, 'JPY': 129.12, 'BGN': 1.9558, 'CZK': 26.226, 'DKK': 7.4366, 'GBP': 0.85655, 'HUF': 367.48, 'PLN': 4.5752, 'RON': 4.8865, 'SEK': 10.1305, 'CHF': 1.1069, 'ISK': 152.1, 'NOK': 10.0813, 'HRK': 7.5865, 'RUB': 87.9744, 'TRY': 9.0269, 'AUD': 1.543, 'BRL':...
# If set, it will update the default panel of the PANEL_DASHBOARD. DEFAULT_PANEL = 'billing_config' PANEL_DASHBOARD = 'billing' PANEL_GROUP = 'default' PANEL = 'billing_config' ADD_PANEL = 'astutedashboard.dashboards.billing.config.panel.Config'
default_panel = 'billing_config' panel_dashboard = 'billing' panel_group = 'default' panel = 'billing_config' add_panel = 'astutedashboard.dashboards.billing.config.panel.Config'
class Node: def __init__(self, data) -> None: self.data = data self.next = None class LinkedList: def __init__(self) -> None: self.head = None def insert(self, item): temp = Node(item) temp.next = self.head self.head = temp def display(node): ...
class Node: def __init__(self, data) -> None: self.data = data self.next = None class Linkedlist: def __init__(self) -> None: self.head = None def insert(self, item): temp = node(item) temp.next = self.head self.head = temp def display(node): temp = n...
#!/usr/bin/env python3 x = "text" # these do the same thing. print("x is:", x) # simply prints two things. print("x is: " + x) # concatenates to string(no space)
x = 'text' print('x is:', x) print('x is: ' + x)
'''https://leetcode.com/problems/n-queens-ii/''' class Solution: def totalNQueens(self, n: int) -> int: board = [[0]*n for _ in range(n)] def placeQ(row, col): board[row][col] = 1 def removeQ(row, col): board[row][col] = 0 d...
"""https://leetcode.com/problems/n-queens-ii/""" class Solution: def total_n_queens(self, n: int) -> int: board = [[0] * n for _ in range(n)] def place_q(row, col): board[row][col] = 1 def remove_q(row, col): board[row][col] = 0 def check(row, col): ...
A = [int(x) for x in input().split()] B = [int(x) for x in input().split()] C = int(input()) ans = [] if C in A: ans.extend(B) if C in B: ans.extend(A) ans = set(ans) print(len(ans)) print(*sorted(ans), sep='\n')
a = [int(x) for x in input().split()] b = [int(x) for x in input().split()] c = int(input()) ans = [] if C in A: ans.extend(B) if C in B: ans.extend(A) ans = set(ans) print(len(ans)) print(*sorted(ans), sep='\n')
def fact(n:int=0)->int: if n <= 0: return (1) if n == 1: return (1) return fact(n-1) + fact(n-2) #main for i in range(0,10): print(f"{fact(i)}", end =" ")
def fact(n: int=0) -> int: if n <= 0: return 1 if n == 1: return 1 return fact(n - 1) + fact(n - 2) for i in range(0, 10): print(f'{fact(i)}', end=' ')
saque = int(input('Valor do saque: R$')) notas = saque while saque != 0: if saque % 50 >= 0: notas = saque if notas // 50 != 0: print(f'Total de {notas//50} notas de R$50,00') saque = saque % 50 if saque % 20 >= 0: notas = saque if notas // 20 != 0: print(f'Total de {nota...
saque = int(input('Valor do saque: R$')) notas = saque while saque != 0: if saque % 50 >= 0: notas = saque if notas // 50 != 0: print(f'Total de {notas // 50} notas de R$50,00') saque = saque % 50 if saque % 20 >= 0: notas = saque if notas // 20 != 0: ...
lista_inteiros = [ [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [9, 1, 8, 9, 9, 7, 2, 1, 6, 8], [1, 3, 2, 2, 8, 6, 5, 9,6, 7], [3, 8, 2, 8, 6, 7, 7, 3, 1, 9], [4, 8, 8, 8, 5, 1, 10, 3, 1, 7], [1, 3, 7, 2, 2, 1, 5, 1, 9, 9], [10, 2, 2, 1, 3, 5, 1, 9, 9], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] ] def encont...
lista_inteiros = [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [9, 1, 8, 9, 9, 7, 2, 1, 6, 8], [1, 3, 2, 2, 8, 6, 5, 9, 6, 7], [3, 8, 2, 8, 6, 7, 7, 3, 1, 9], [4, 8, 8, 8, 5, 1, 10, 3, 1, 7], [1, 3, 7, 2, 2, 1, 5, 1, 9, 9], [10, 2, 2, 1, 3, 5, 1, 9, 9], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]] def encontra_duplicado(parametro): numer...
# Maltego Entities - Maltego Chlorine 3.6.0 # Parser written by: # Justin Seitz - justin@hunch.ly class Unknown(object): def __init__(self, entity_value): self.entity_value = entity_value self.entity_type = "maltego.Unknown" self.entity_attributes = {} self.entity_attribute_names = ...
class Unknown(object): def __init__(self, entity_value): self.entity_value = entity_value self.entity_type = 'maltego.Unknown' self.entity_attributes = {} self.entity_attribute_names = {} pass class Computer(object): def __init__(self, entity_value): self.entit...
# python3 (this comment tells the grading system at Coursera to use python3 rather than python3) def sum_of_two_digits(first_digit, second_digit): assert 0 <= first_digit <= 9 and 0 <= second_digit <= 9 return first_digit + second_digit if __name__ == '__main__': a, b = map(int, input().split()) pri...
def sum_of_two_digits(first_digit, second_digit): assert 0 <= first_digit <= 9 and 0 <= second_digit <= 9 return first_digit + second_digit if __name__ == '__main__': (a, b) = map(int, input().split()) print(sum_of_two_digits(a, b))
for a in range(1,100): for b in range(1,100): for c in range(1,100): if a*a == b*b + c*c: print(a , b , c) elif b*b == a*a + c*c: print(b , a , c) elif c*c == a*a + b*b: print(c , a , b)
for a in range(1, 100): for b in range(1, 100): for c in range(1, 100): if a * a == b * b + c * c: print(a, b, c) elif b * b == a * a + c * c: print(b, a, c) elif c * c == a * a + b * b: print(c, a, b)
grid = [[int(x) for x in line] for line in open('input.txt').read().splitlines()] def dijkstra(grid, start, stop): distances, temp = {}, {start: 0} while len(temp)>0: # set closest point as definite x,y = min(temp, key=temp.get) distance = temp.pop((x,y)) distances[(x,y)] = dist...
grid = [[int(x) for x in line] for line in open('input.txt').read().splitlines()] def dijkstra(grid, start, stop): (distances, temp) = ({}, {start: 0}) while len(temp) > 0: (x, y) = min(temp, key=temp.get) distance = temp.pop((x, y)) distances[x, y] = distance nbs = [(x + i, y +...
class Solution: def slidingPuzzle(self, board: List[List[int]]) -> int: # 0 1 2 # 3 4 5 target = '123450' start = ''.join(map(str, board[0])) + ''.join(map(str, board[1])) start_idx = start.index('0') moves = [(1, 3), (0, 2, 4), (1, 5), (0, 4), (1, 3, 5), (2, 4)] ...
class Solution: def sliding_puzzle(self, board: List[List[int]]) -> int: target = '123450' start = ''.join(map(str, board[0])) + ''.join(map(str, board[1])) start_idx = start.index('0') moves = [(1, 3), (0, 2, 4), (1, 5), (0, 4), (1, 3, 5), (2, 4)] step = 0 levels = ...
# define a class class Dog(object): kind = "canine" # class variable def __init__(self, name): self.name = name #instance variable self.tricks = [] #instance variable def add_trick(self, trick): self.tricks.append(trick) # instance of a class e = Dog('Buddy') #first instance d = Dog...
class Dog(object): kind = 'canine' def __init__(self, name): self.name = name self.tricks = [] def add_trick(self, trick): self.tricks.append(trick) e = dog('Buddy') d = dog('Fido') x = object() e.add_trick('roll over') d.add_trick('play dead') print(e.name, e.tricks) print(d.name,...
def main(context): session = context.session session.execute("INSERT INTO test (id, name) values (1, 'jon')")
def main(context): session = context.session session.execute("INSERT INTO test (id, name) values (1, 'jon')")
class ErrorTrapTransport(Exception): pass class ConfigNotFoundError(Exception): pass class ConfigNotParsedError(Exception): pass class MibCompileError(Exception): pass class MibCompileFailed(Exception): pass class FilterPathError(Exception): pass class FilterProcessError(Exception): pass c...
class Errortraptransport(Exception): pass class Confignotfounderror(Exception): pass class Confignotparsederror(Exception): pass class Mibcompileerror(Exception): pass class Mibcompilefailed(Exception): pass class Filterpatherror(Exception): pass class Filterprocesserror(Exception): pa...
H,W,*A = [x for x in open(0).read().split()] H=int(H) W=int(W) whites=[0]*W for a in A: for i,c in enumerate(a): if c=='.': whites[i]+=1 checks=[white != H for white in whites] wline='.'*W for a in A: if a == wline: continue print(''.join([c for i,c in enumerate(a) if checks[i]])...
(h, w, *a) = [x for x in open(0).read().split()] h = int(H) w = int(W) whites = [0] * W for a in A: for (i, c) in enumerate(a): if c == '.': whites[i] += 1 checks = [white != H for white in whites] wline = '.' * W for a in A: if a == wline: continue print(''.join([c for (i, c) in...
# # PySNMP MIB module HARMONIC-INC-NSG9000-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HARMONIC-INC-NSG9000-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 19:11:45 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7....
(integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_range_constraint, constraints_union, constraints_intersection, value_size_constraint, single_value_constraint) ...
# status: testado com exemplos da prova if __name__ == '__main__': N = input() values = [int(x) for x in input().split()] max_record = 0 last_record = 0 last_value = 0 for value in values: last_record += 1 if not value == last_value: last_record = 1 max_rec...
if __name__ == '__main__': n = input() values = [int(x) for x in input().split()] max_record = 0 last_record = 0 last_value = 0 for value in values: last_record += 1 if not value == last_value: last_record = 1 max_record = last_record if last_record > max_reco...
P = 1000000007 # edit this Q = 2210070043 # edit this N = P * Q print(f"N={N} -- tell Bob this") Z = (P - 1) * (Q - 1) print(f"Z={Z}") print("Pick a different number between 1 and Z") E = 49979693 # edit this to be a different prime number between 1 and Z print(f"E={E} (public key)") D = pow(E, -1, Z) print(f"D=...
p = 1000000007 q = 2210070043 n = P * Q print(f'N={N} -- tell Bob this') z = (P - 1) * (Q - 1) print(f'Z={Z}') print('Pick a different number between 1 and Z') e = 49979693 print(f'E={E} (public key)') d = pow(E, -1, Z) print(f'D={D} (private key)') c = 653470184995596571 m = pow(C, D, N) print(f'Secret message M = {M}...
# TODO add linters, automated tests, etc def gos_py_library(name, **kwargs): native.py_library( name = name, **kwargs ) def gos_py_binary(name, **kwargs): native.py_binary( name = name, **kwargs ) def gos_py_test(name, **kwargs): native.py_test( name = name...
def gos_py_library(name, **kwargs): native.py_library(name=name, **kwargs) def gos_py_binary(name, **kwargs): native.py_binary(name=name, **kwargs) def gos_py_test(name, **kwargs): native.py_test(name=name, **kwargs)
''' File: __init__.py Project: optimizer File Created: Monday, 17th August 2020 3:52:54 pm Author: Sparsh Dutta (sparsh.dtt@gmail.com) ----- Last Modified: Monday, 17th August 2020 3:52:54 pm Modified By: Sparsh Dutta (sparsh.dtt@gmail.com>) ----- Copyright 2020 Sparsh Dutta '''
""" File: __init__.py Project: optimizer File Created: Monday, 17th August 2020 3:52:54 pm Author: Sparsh Dutta (sparsh.dtt@gmail.com) ----- Last Modified: Monday, 17th August 2020 3:52:54 pm Modified By: Sparsh Dutta (sparsh.dtt@gmail.com>) ----- Copyright 2020 Sparsh Dutta """
class Route: def __init__(self, routes, graph): self.routes = routes self.graph = graph self.v_start = graph[0] self.dist = self.route_dist() def route_dist(self): '''total route distance (fitness)''' total_dist = 0 for route in self.routes: ...
class Route: def __init__(self, routes, graph): self.routes = routes self.graph = graph self.v_start = graph[0] self.dist = self.route_dist() def route_dist(self): """total route distance (fitness)""" total_dist = 0 for route in self.routes: ...
#Given two (singly) linked lists, determine if the two lists intersect. Return the intersecting node . Note that the intersetion is defined #based on reference, not value. That is if kth node of the first linked list is the exact same node(by reference) as the jth node of the #second linked list, the they are intersec...
class Node: next = None def __init__(self, value): self.value = value class Linkedlist: head = None tail = None size = 0 def debug(self): current = self.head while current: print(current.value) current = current.next def insert(self, value)...
EPOCHS = 3 LOG_ITER = 25 TEST_ITER = 50 WRITE_PERIOD = 100 #1440 train examples #360 train examples
epochs = 3 log_iter = 25 test_iter = 50 write_period = 100
class BaseLinOp: def __init__(self): pass @property def T(self): return Adjoint(self) def __add__(self, other): if isinstance(other, BaseLinOp): return Sum(self, other) else: return ScalarSum(self, other) def __radd__(self, other): i...
class Baselinop: def __init__(self): pass @property def t(self): return adjoint(self) def __add__(self, other): if isinstance(other, BaseLinOp): return sum(self, other) else: return scalar_sum(self, other) def __radd__(self, other): ...
# # PySNMP MIB module Nortel-MsCarrier-MscPassport-LogicalProcessorMIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Nortel-MsCarrier-MscPassport-LogicalProcessorMIB # Produced by pysmi-0.3.4 at Mon Apr 29 20:19:33 2019 # On host DAVWANG4-M-1475 platform Darwin version 18....
(object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_range_constraint, single_value_constraint, constraints_union, value_size_constraint, constraints_intersection) ...
txt = "one one was a race horse, two two was one too." x = txt.replace("one", "three", 2) print(x)
txt = 'one one was a race horse, two two was one too.' x = txt.replace('one', 'three', 2) print(x)
description = 'Verify the user can create a new page from the project page' pages = ['login', 'common', 'index', 'project_pages'] def setup(data): common.access_golem(data.env.url, data.env.admin) index.create_access_project('test') common.navigate_menu('Pages') def test(data)...
description = 'Verify the user can create a new page from the project page' pages = ['login', 'common', 'index', 'project_pages'] def setup(data): common.access_golem(data.env.url, data.env.admin) index.create_access_project('test') common.navigate_menu('Pages') def test(data): store('page_name', 'pag...
class PatternLibraryException(Exception): pass class TemplateIsNotPattern(PatternLibraryException): pass class PatternLibraryEmpty(PatternLibraryException): pass
class Patternlibraryexception(Exception): pass class Templateisnotpattern(PatternLibraryException): pass class Patternlibraryempty(PatternLibraryException): pass
def load_input(): cases = open("input.txt", "r").readlines() for i in range(len(cases)): cases[i] = cases[i].replace('\n','') return cases groups = [] def parse_input(): inp = load_input() inp_len = len(inp) group = [] for i in range(inp_len): line = inp[i] if line ...
def load_input(): cases = open('input.txt', 'r').readlines() for i in range(len(cases)): cases[i] = cases[i].replace('\n', '') return cases groups = [] def parse_input(): inp = load_input() inp_len = len(inp) group = [] for i in range(inp_len): line = inp[i] if line ...
USCIS_CONFIG = { 'hostname': 'egov.uscis.gov', 'endpoint': '/casestatus/mycasestatus.do', 'querytype': 'CHECK STATUS' }
uscis_config = {'hostname': 'egov.uscis.gov', 'endpoint': '/casestatus/mycasestatus.do', 'querytype': 'CHECK STATUS'}
# -*- coding: utf-8 -*- bind = '{{ gunicorn_bind }}' pidfile = '{{ gunicorn_pidfile }}' proc_name = 'slugify' user = '{{ web_user }}' loglevel = 'warn' errorlog = '-' accesslog = '-'
bind = '{{ gunicorn_bind }}' pidfile = '{{ gunicorn_pidfile }}' proc_name = 'slugify' user = '{{ web_user }}' loglevel = 'warn' errorlog = '-' accesslog = '-'
budget_for_the_film = float(input("Enter the budget for the film: ")) number_of_extras = int(input("Enter the number of extras: ")) clothes_price_per_extra = float(input("Enter the price of the clothes per extra: ")) decor_price = budget_for_the_film * 0.1 clothes_price = number_of_extras * clothes_price_per_extra if...
budget_for_the_film = float(input('Enter the budget for the film: ')) number_of_extras = int(input('Enter the number of extras: ')) clothes_price_per_extra = float(input('Enter the price of the clothes per extra: ')) decor_price = budget_for_the_film * 0.1 clothes_price = number_of_extras * clothes_price_per_extra if n...
class graph(object): def __init__(self, nodes, edge_list = None): self.N = nodes self.A = [[False for i in range(self.N+1)] for j in range(self.N+1)] # initialise the adjacency matrix as an (N+1)*(N+1) array, so we can use indexes from 1. if edge_list != None: # let's optionally give this c...
class Graph(object): def __init__(self, nodes, edge_list=None): self.N = nodes self.A = [[False for i in range(self.N + 1)] for j in range(self.N + 1)] if edge_list != None: for x in edge_list: self.set_edge(x) def is_valid_tuple(self, x): return isi...
# # PySNMP MIB module UCD-SNMP-MIB (http://pysnmp.sf.net) # ASN.1 source http://mibs.snmplabs.com:80/asn1/UCD-SNMP-MIB # Produced by pysmi-0.0.7 at Sun Feb 14 00:32:22 2016 # On host bldfarm platform Linux version 4.1.13-100.fc21.x86_64 by user goose # Using Python version 3.5.0 (default, Jan 5 2016, 17:11:52) # ( Oc...
(octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, constraints_intersection, value_size_constraint, value_range_constraint, constraints_union) ...
def printing(T): print (f'hello {T}') w=__name__ if w=="__main__": printing("wajaht")
def printing(T): print(f'hello {T}') w = __name__ if w == '__main__': printing('wajaht')
x = [1, [2, None]] y = [1, 2] z = [1, 2] x[1][0] = y # should nudge y to over the right z[1] = x # should nudge BOTH x and y over to the right
x = [1, [2, None]] y = [1, 2] z = [1, 2] x[1][0] = y z[1] = x
# earth_coords.py # # For coordinates relative to Earth's surface, # in terms of latitude, longitude, and altitude. # All stored as floats. # # E.g., the GPS antenna in our window in the APCR-DRDL lab is at: # latitude = 30.428236 degrees (N) # longitude = -84.285 degrees (W) # altitude = 40 m...
__all__ = ['EarthCoords'] class Earthcoords: def __init__(this, lat, long, alt): this.lat = lat this.long = long this.alt = alt def deg_to_degmin(degrees): intdeg = int(degrees) fracdeg = abs(degrees - intdeg) minutes = fracdeg * 60 return (intdeg, minutes) def deg_to_deg...
class Car: someStaticPublicVar = 'Abc' def __init__(self, name, make, year): self.name = name self.make = make self.year = year def drive(self): print(self.name + " started") @staticmethod def hello(): print("Hello from car") @classmethod def show(...
class Car: some_static_public_var = 'Abc' def __init__(self, name, make, year): self.name = name self.make = make self.year = year def drive(self): print(self.name + ' started') @staticmethod def hello(): print('Hello from car') @classmethod def sh...
# Author : @Moglten # Fizz , Buzz and Fizzbuzz # from 1 to 100 def printFizzBuzz(n) : for x in range(1,n+1) : print(x) if print_FizzBuzz(x) else None def print_FizzBuzz(n): if n % 5 == n % 3 == 0: print( "FizzBuzz" ) return False else: return print_Buzz( n ) def print_Buz...
def print_fizz_buzz(n): for x in range(1, n + 1): print(x) if print__fizz_buzz(x) else None def print__fizz_buzz(n): if n % 5 == n % 3 == 0: print('FizzBuzz') return False else: return print__buzz(n) def print__buzz(n): if n % 5 == 0: print('Buzz') retur...
def Union2SortedArrays(arr1, arr2): m = arr1[-1] n = arr2[-1] ans = 0 if m > n: ans = m else: ans = n returner = [] newtable = [0] * (ans + 1) returner.append(arr1[0]) newtable[arr1[0]] += 1 for i in range(1, len(arr1)): if arr1[i] != arr1[i - 1]: returner.append(arr1[i]) n...
def union2_sorted_arrays(arr1, arr2): m = arr1[-1] n = arr2[-1] ans = 0 if m > n: ans = m else: ans = n returner = [] newtable = [0] * (ans + 1) returner.append(arr1[0]) newtable[arr1[0]] += 1 for i in range(1, len(arr1)): if arr1[i] != arr1[i - 1]: ...
#!/usr/bin/env python # encoding: utf-8 class Solution: def nthUglyNumber(self, n: int) -> int: if n == 0: return 0 seen = {1, } heap = [] heapq.heappush(heap, 1) for _ in range(n): ugly_number = heapq.heappop(heap) for i in [2, 3, 5]: ...
class Solution: def nth_ugly_number(self, n: int) -> int: if n == 0: return 0 seen = {1} heap = [] heapq.heappush(heap, 1) for _ in range(n): ugly_number = heapq.heappop(heap) for i in [2, 3, 5]: new_ugly = ugly_number * i ...
filename = 'alice.txt' # with open(filename, encoding='utf-8') as file_object: # contents = file_object.read() try: with open(filename, encoding='utf-8') as file_object: contents = file_object.read() except FileNotFoundError: print(f"Sorry, the file {filename} does not exist.") else: # Calculat...
filename = 'alice.txt' try: with open(filename, encoding='utf-8') as file_object: contents = file_object.read() except FileNotFoundError: print(f'Sorry, the file {filename} does not exist.') else: words = contents.split() num_words = len(words) print(f'The file {filename} has about {num_word...
# Basic Calculator II: https://leetcode.com/problems/basic-calculator-ii/ # Given a string s which represents an expression, evaluate this expression and return its value. # The integer division should truncate toward zero. # Note: You are not allowed to use any built-in function which evaluates strings as mathematica...
class Solution: def calculate(self, s: str) -> int: if len(s) == 0: return 0 (operand, sign) = (0, '+') stack = [] for i in range(len(s)): char = s[i] if char is not ' ': if char.isdigit(): operand = operand * 1...
class Solution: def __init__(self): self.keys = { '2': 'abc', '3': 'def', '4': 'ghi', '5': 'jkl', '6': 'mno', '7': 'pqrs', '8': 'tuv', '9': 'wxyz' } # straightforward solution, easier to understand ...
class Solution: def __init__(self): self.keys = {'2': 'abc', '3': 'def', '4': 'ghi', '5': 'jkl', '6': 'mno', '7': 'pqrs', '8': 'tuv', '9': 'wxyz'} def letter_combinations(self, digits: str) -> list[str]: if digits == '': return [] results = [''] for digit in digits:...
wildcards = ['wildcard1', 'wildcard2', 'wildcard3', 'wildcard4'] class Player: def __init__(self, name, rfid, skills): self.name = name self.rfid = rfid self.skills = skills def __str__(self): return 'Player {} ({}, {})'.format(self.name, self.rfid, list(self.skills)) def ...
wildcards = ['wildcard1', 'wildcard2', 'wildcard3', 'wildcard4'] class Player: def __init__(self, name, rfid, skills): self.name = name self.rfid = rfid self.skills = skills def __str__(self): return 'Player {} ({}, {})'.format(self.name, self.rfid, list(self.skills)) def...
saarc = [ 'Afganistan', 'Bangladesh', 'Bhutan', 'Nepal', 'India', 'Pakistan', 'Sri Lanka' ] print(saarc) if "Bangladesh" in saarc: print("Bangladesh is in Saarc")
saarc = ['Afganistan', 'Bangladesh', 'Bhutan', 'Nepal', 'India', 'Pakistan', 'Sri Lanka'] print(saarc) if 'Bangladesh' in saarc: print('Bangladesh is in Saarc')
def isOneAway(s1, s2): if len(s1) == len(s2): # check replace replace = False for c1, c2 in zip(s1, s2): if c1 != c2: if replace: return False else: replace = True return True elif len(s1) == len(...
def is_one_away(s1, s2): if len(s1) == len(s2): replace = False for (c1, c2) in zip(s1, s2): if c1 != c2: if replace: return False else: replace = True return True elif len(s1) == len(s2) + 1: del...
class Coord: def __init__(self, x, y): self.x = x self.y = y class Ball: def __init__(self, x, y): self.diameter = 0.1 self.x = x self.y = y self.coord = Coord(x,y) class ObjectBall(Ball): pass class One(ObjectBall): pass class Two(ObjectBall): pas...
class Coord: def __init__(self, x, y): self.x = x self.y = y class Ball: def __init__(self, x, y): self.diameter = 0.1 self.x = x self.y = y self.coord = coord(x, y) class Objectball(Ball): pass class One(ObjectBall): pass class Two(ObjectBall): ...
class ZomatoLocation(): def __init(self, entity_type, entity_id, title, latitude, longitude, city_id, city_name, country_id, country_name): self.entity_type = entity_type self.entity_id = entity_id self.title = title self.latitude = latitude self.longitude = longitude ...
class Zomatolocation: def __init(self, entity_type, entity_id, title, latitude, longitude, city_id, city_name, country_id, country_name): self.entity_type = entity_type self.entity_id = entity_id self.title = title self.latitude = latitude self.longitude = longitude ...
g=open(accountList, r) pickle.load(adminUsers) print("Welcome to AdminTools!") print("Please enter your official AdminTools account credentials:") print("NOTE: You may enter your PythonG Live account credentials if you have access.") print("Please enter your admin username:") adminu = input() print("Please enter your a...
g = open(accountList, r) pickle.load(adminUsers) print('Welcome to AdminTools!') print('Please enter your official AdminTools account credentials:') print('NOTE: You may enter your PythonG Live account credentials if you have access.') print('Please enter your admin username:') adminu = input() print('Please enter your...
''' Copyright [2020] [Timothy Chua] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software ...
""" Copyright [2020] [Timothy Chua] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software ...
D, J = [map(int, input().split()) for _ in range(2)] ans = 0 for d, j in zip(D, J): ans += max(d, j) print(ans)
(d, j) = [map(int, input().split()) for _ in range(2)] ans = 0 for (d, j) in zip(D, J): ans += max(d, j) print(ans)
#!/usr/bin/python3.4 count = 0 while count < 9: print("The count is: ", count) count = count + 1 print("Good bye")
count = 0 while count < 9: print('The count is: ', count) count = count + 1 print('Good bye')
def ColourNames(filename) -> dict: rtn = {} with open(filename) as handle: for line in handle: line = line.strip() r, g, b, name = line.split(maxsplit=3) rtn[name] = [int(r), int(g), int(b)] return rtn
def colour_names(filename) -> dict: rtn = {} with open(filename) as handle: for line in handle: line = line.strip() (r, g, b, name) = line.split(maxsplit=3) rtn[name] = [int(r), int(g), int(b)] return rtn
# # Hubblemon - Yet another general purpose system monitor # # Copyright 2015 NAVER Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
alarm_conf_absolute = {'default': {'rusage_user': (500000, 1000000, None), 'rusage_system': (500000, 1000000, None), 'evictions': (80000, 100000, 120000), 'reclaimed': (80000, None, None), 'cmd_get': (40000, 80000, 200000), 'cmd_set': (40000, 80000, 200000)}, 'band': {'evictions': (150000, 150000, 200000)}} alarm_conf_...
# model model = Model() i1 = Input("op1", "TENSOR_FLOAT32", "{3, 2, 2, 2}") i2 = Input("op2", "TENSOR_FLOAT32", "{2, 2}") act = Int32Scalar("act", 0) # an int32_t scalar fuse_activation i3 = Output("op3", "TENSOR_FLOAT32", "{3, 2, 2, 2}") model = model.Operation("SUB", i1, i2, act).To(i3) # Example 1. Input in operand...
model = model() i1 = input('op1', 'TENSOR_FLOAT32', '{3, 2, 2, 2}') i2 = input('op2', 'TENSOR_FLOAT32', '{2, 2}') act = int32_scalar('act', 0) i3 = output('op3', 'TENSOR_FLOAT32', '{3, 2, 2, 2}') model = model.Operation('SUB', i1, i2, act).To(i3) input0 = {i1: [0.02648412, 0.12737854, 0.92319058, 0.60023185, 0.35821535...
# int: signed, unlimited signed precision integer # specified in decimal by default print("Decimal 10: " + str(10)) print("Binary 10: " + str(0b10)) print("Octal 10: " + str(0o10)) print("Hex 10: " + str(0x10)) # Conversation from float (rounded off to nearest int towards 0) print("3.5 in int is " + str(in...
print('Decimal 10: ' + str(10)) print('Binary 10: ' + str(2)) print('Octal 10: ' + str(8)) print('Hex 10: ' + str(16)) print('3.5 in int is ' + str(int(3.5))) print('3.6 in int is ' + str(int(3.6))) print('-3.6 in int is ' + str(int(-3.6))) print('String 456 to int: ' + str(int('456'))) print('A floating point number: ...
load("@rules_jvm_external//:defs.bzl", "maven_install") def hocon_repositories(): maven_install( name = "hocon_maven", artifacts = [ "com.typesafe:config:1.3.3", "org.rogach:scallop_2.12:3.3.2", ], repositories = [ "https://repo.maven.apache.org/m...
load('@rules_jvm_external//:defs.bzl', 'maven_install') def hocon_repositories(): maven_install(name='hocon_maven', artifacts=['com.typesafe:config:1.3.3', 'org.rogach:scallop_2.12:3.3.2'], repositories=['https://repo.maven.apache.org/maven2', 'https://maven-central.storage-download.googleapis.com/maven2', 'https:...
#The database URI that should be used for the connection. #fomate: dialect+driver://username:password@host:port/database #mysql format : mysql://scott:tiger@localhost/database_name SQLALCHEMY_DATABASE_URI = 'mysql://root:63005610@localhost/cuit_acm' #A dictionary that maps bind keys to SQLAlchemy connection URIs. SQL...
sqlalchemy_database_uri = 'mysql://root:63005610@localhost/cuit_acm' sqlalchemy_binds = {} admin = ['Rayn', 'dreameracm'] oj_map = {'hdu': 'HDU', 'cf': 'Codeforces', 'bc': 'BestCoder', 'poj': 'POJ', 'uva': 'UVA', 'zoj': 'ZOJ', 'bnu': 'BNU', 'vj': 'Virtual Judge'} server_time_deltta = 6 csrf_enabled = True secret_key = ...
# a2_q2.py def check_teams(graph, csp_sol): total_var = len(csp_sol) for i in range(total_var): for j in range(1,total_var): if csp_sol[i] == csp_sol[j]: if j in graph[i]: return False return True
def check_teams(graph, csp_sol): total_var = len(csp_sol) for i in range(total_var): for j in range(1, total_var): if csp_sol[i] == csp_sol[j]: if j in graph[i]: return False return True
SHAPES = ['pin', 'airport', 'hospital', 'home', 'dot', 'start', 'heart', 'flag'] COLORS = { 'amber' : ('FFC107', 'FF6F00'), 'blakwhite' : ('000000', 'FFFFFF'), 'blue' : ('2196F3', '0D47A1'), 'bluewhite' : ('0277BD', 'FFFFFF'), 'cyan' : ('00BCD4', '006064'), 'deeppurple':...
shapes = ['pin', 'airport', 'hospital', 'home', 'dot', 'start', 'heart', 'flag'] colors = {'amber': ('FFC107', 'FF6F00'), 'blakwhite': ('000000', 'FFFFFF'), 'blue': ('2196F3', '0D47A1'), 'bluewhite': ('0277BD', 'FFFFFF'), 'cyan': ('00BCD4', '006064'), 'deeppurple': ('673AB7', '311B92'), 'deeporange': ('FF5722', 'BF360C...
#! /usr/bin/python3 #! @authot: @ruhend (Mudigonda Himansh) #! CRC Encoder def list2int(mylist): char_divisor = [str(integer) for integer in mylist] str_divisor = "". join(char_divisor) int_divisor = int(str_divisor,2 ) return int_divisor def DecimalToBinary(num): answer = [] if num >= 1: ...
def list2int(mylist): char_divisor = [str(integer) for integer in mylist] str_divisor = ''.join(char_divisor) int_divisor = int(str_divisor, 2) return int_divisor def decimal_to_binary(num): answer = [] if num >= 1: decimal_to_binary(num // 2) bindigit = num % 2 answer.append(bi...
class PexOSDeprovisionHandler(object): def __init__(self): pass def run(self, force=False, deluser=False): return def run_changed_unique_id(self): return
class Pexosdeprovisionhandler(object): def __init__(self): pass def run(self, force=False, deluser=False): return def run_changed_unique_id(self): return
class TPDO: def __init__(self, index): pass class RPDO: def __init__(self, index): pass
class Tpdo: def __init__(self, index): pass class Rpdo: def __init__(self, index): pass
fname = input('Enter a filename:') try: fhand = open(fname) except: print('File cannot be opened:', fname) exit() for line in fhand: words = line.split() if len(words) >= 3 and words[0] == 'From': print(words[2])
fname = input('Enter a filename:') try: fhand = open(fname) except: print('File cannot be opened:', fname) exit() for line in fhand: words = line.split() if len(words) >= 3 and words[0] == 'From': print(words[2])
def main(): lM = lambda arg: arg * 2 print(lM(5)) # 10 print(lM(0)) # 0 print(lM(10)) # 20 my_list = [1, 5, 4, 6, 8, 11, 3, 12] new_list = list(filter(lambda x: (x%2 == 0), my_list)) print(new_list) pass if __name__ == "__main__": main()
def main(): l_m = lambda arg: arg * 2 print(l_m(5)) print(l_m(0)) print(l_m(10)) my_list = [1, 5, 4, 6, 8, 11, 3, 12] new_list = list(filter(lambda x: x % 2 == 0, my_list)) print(new_list) pass if __name__ == '__main__': main()
N=10 for x in range (N): for y in range (N): print (x,y,x*y)
n = 10 for x in range(N): for y in range(N): print(x, y, x * y)
''' Exercise 2: Write in pseudo code a function merge(listA: List, listB: List) that returns a sorted list containing the elements of both list where listA and listB are two sorted lists of integers. If an element exists in both lists, it must appear multiple times in the returned list. For example: >>> merge([1,3,4,7]...
""" Exercise 2: Write in pseudo code a function merge(listA: List, listB: List) that returns a sorted list containing the elements of both list where listA and listB are two sorted lists of integers. If an element exists in both lists, it must appear multiple times in the returned list. For example: >>> merge([1,3,4,7]...
def unique_paths_with_obstacles(obstacle_grid): if obstacle_grid is None or len(obstacle_grid) == 0 or obstacle_grid[0] is None or len(obstacle_grid[0]) == 0: return 0 m = len(obstacle_grid) n = len(obstacle_grid[0]) dp = [0 for i in range(n)] for i in range(n): if obstacle_grid[0]...
def unique_paths_with_obstacles(obstacle_grid): if obstacle_grid is None or len(obstacle_grid) == 0 or obstacle_grid[0] is None or (len(obstacle_grid[0]) == 0): return 0 m = len(obstacle_grid) n = len(obstacle_grid[0]) dp = [0 for i in range(n)] for i in range(n): if obstacle_grid[0]...
a=float(input()) b=float(input()) c=float(input()) d=float(input()) e=float(input()) f=float(input()) x=0 y=0 if a>=0: x=x+1 y=y+a if b>=0: x=x+1 y=y+b if c>=0: x=x+1 y=y+c if d>=0: x=x+1 y=y+d if e>=0: x=x+1 y=y+e if f>=0: x=x+1 y=y+f media=y/x print("%d valores positivos"%x) print("%....
a = float(input()) b = float(input()) c = float(input()) d = float(input()) e = float(input()) f = float(input()) x = 0 y = 0 if a >= 0: x = x + 1 y = y + a if b >= 0: x = x + 1 y = y + b if c >= 0: x = x + 1 y = y + c if d >= 0: x = x + 1 y = y + d if e >= 0: x = x + 1 y = y + e...
def main(): SX, SY, GX, GY = map(int, input().split()) print((SY*GX+SX*GY) / (SY+GY)) if __name__ == "__main__": main()
def main(): (sx, sy, gx, gy) = map(int, input().split()) print((SY * GX + SX * GY) / (SY + GY)) if __name__ == '__main__': main()
'''Implement a program to calculate sum of odd digits present in the given number Input Format a number from the user Constraints n>0 Output Format print sum of odd digits Sample Input 0 123 Sample Output 0 4 Sample Input 1 101 Sample Output 1 2''' #solution n = input() sum = 0 for i in n: if int(i)%2 ==...
"""Implement a program to calculate sum of odd digits present in the given number Input Format a number from the user Constraints n>0 Output Format print sum of odd digits Sample Input 0 123 Sample Output 0 4 Sample Input 1 101 Sample Output 1 2""" n = input() sum = 0 for i in n: if int(i) % 2 == 1: ...
def GetCardType(models): return "Japanese (recognition&recall)" def MakeCard(data): result = {} if 'front_word' not in data and 'back_word' not in data or 'read_word' not in data: return result result['Expression'] = data['front_word'] result['Meaning'] = data['back_word'] result['Rea...
def get_card_type(models): return 'Japanese (recognition&recall)' def make_card(data): result = {} if 'front_word' not in data and 'back_word' not in data or 'read_word' not in data: return result result['Expression'] = data['front_word'] result['Meaning'] = data['back_word'] result['Re...
class Solution: def containsNearbyAlmostDuplicate(self, nums: List[int], k: int, t: int) -> bool: if t < 0 or k <= 0: return False table = {} w = 1 + t for i, num in enumerate(nums): curr = num // w if curr in table: return True ...
class Solution: def contains_nearby_almost_duplicate(self, nums: List[int], k: int, t: int) -> bool: if t < 0 or k <= 0: return False table = {} w = 1 + t for (i, num) in enumerate(nums): curr = num // w if curr in table: return Tr...
while True: try: a,b=map(int,input().split()) c=a^b print(c) except EOFError:break
while True: try: (a, b) = map(int, input().split()) c = a ^ b print(c) except EOFError: break
catlog = ['Show Filter On Binary', 'Show Smooth The Rec', 'Show Smooth The Gear', 'Show Dog The Gear', 'Show QRCode Art', '-', 'Show Dilation', 'Show Erosion', 'Show Open And Close', '-', 'Show Fill Holes', 'Show Outline', 'Show ConvexHull', 'Show Skeleton', '-', 'Show Distance', 'Show Max Circle', 'Show Medial Axis'...
catlog = ['Show Filter On Binary', 'Show Smooth The Rec', 'Show Smooth The Gear', 'Show Dog The Gear', 'Show QRCode Art', '-', 'Show Dilation', 'Show Erosion', 'Show Open And Close', '-', 'Show Fill Holes', 'Show Outline', 'Show ConvexHull', 'Show Skeleton', '-', 'Show Distance', 'Show Max Circle', 'Show Medial Axis', ...
limit = 25 subreddit = 'cscareerquestions' client_id = '???' client_secret = '???' user_agent = 'python:X.Y.Z:v1.0.0 (by /u/???)' gmail_user = '???@???.???' gmail_password = '???' sender = '???@???.???' recipient = '???@???.???' subject = 'Top Trending on /r/%s' % (subreddit)
limit = 25 subreddit = 'cscareerquestions' client_id = '???' client_secret = '???' user_agent = 'python:X.Y.Z:v1.0.0 (by /u/???)' gmail_user = '???@???.???' gmail_password = '???' sender = '???@???.???' recipient = '???@???.???' subject = 'Top Trending on /r/%s' % subreddit
NOT_ALLOWED = ["", None, True, False, [], {}] def arrayLength(arr, length): if len(arr) == length: return True else: return False def checkFields(staticFields, dataFields): requiredfields = list(set(staticFields) - set(dataFields)) extraFields = list(set(dataFields) - set(staticField...
not_allowed = ['', None, True, False, [], {}] def array_length(arr, length): if len(arr) == length: return True else: return False def check_fields(staticFields, dataFields): requiredfields = list(set(staticFields) - set(dataFields)) extra_fields = list(set(dataFields) - set(staticFiel...
# TODO get wall-tower headings for Transdec regions # PINGER_FREQUENCY = 30000 # Region A # PINGER_FREQUENCY = 40000 # Region B # PINGER_FREQUENCY = 25000 # Region C # PINGER_FREQUENCY = 35000 # Region D PINGER_FREQUENCY = 30000 TRACK_MAG_THRESH = 10.8 TRACK_COOLDOWN_SAMPLES = 188000 RIGHT_HANDED = False PATH_1_BEND...
pinger_frequency = 30000 track_mag_thresh = 10.8 track_cooldown_samples = 188000 right_handed = False path_1_bend_right = RIGHT_HANDED path_2_bend_right = RIGHT_HANDED
manager22222 ssssss
manager22222 ssssss
dtype = object transformers = [ lambda _: _.transpose(), lambda _: _.rename_axis( mapper='variable', axis='index' ), ]
dtype = object transformers = [lambda _: _.transpose(), lambda _: _.rename_axis(mapper='variable', axis='index')]
# Created by MechAviv # Map ID :: 807000000 # Momijigaoka : Momijigaoka sm.setTemporarySkillSet(0) sm.setInGameDirectionMode(False, True, False, False)
sm.setTemporarySkillSet(0) sm.setInGameDirectionMode(False, True, False, False)
class Solution: def wordBreak(self, s: str, wordDict: List[str]) -> bool: #base case if(len(s) == 1): if(s in wordDict): return True; else: return False; pyt queue = [0]; visited = [0] * len(s) while(len(queu...
class Solution: def word_break(self, s: str, wordDict: List[str]) -> bool: if len(s) == 1: if s in wordDict: return True else: return False pyt queue = [0] visited = [0] * len(s) while len(queue) != 0: s...