Skip to content

Instantly share code, notes, and snippets.

View mcxemic's full-sized avatar
🤸‍♂️

Eugene Korostylov mcxemic

🤸‍♂️
View GitHub Profile
from collections import defaultdict
import requests
import typing as t
import time
from datetime import datetime, date
MONO_ENDPOINT = "https://api.monobank.ua/"
MY_TOKEN = "some_very_secret_token"
INVOICE_PATH = "/personal/statement/0/{from_ts}"
import re
import sys
MAX_INT = sys.maxsize
def get_time_from_string(time_string):
time_value = "".join(re.split("[a-zA-Z]", time_string))
time_format = "".join(re.split('\d+:\d+', time_string)).lower()
[hours, minutes] = time_value.split(":")
hours = int(hours) if int(hours) < 12 else 0
def two_sum(arr):
desired_amount = arr.pop(0)
result = []
while len(arr) > 0:
current_value = arr.pop(0)
search_value = desired_amount - current_value
if search_value in arr:
arr.remove(search_value)
result.append((current_value, search_value))
return result