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 search_pairs(array, k): | |
seen = {} | |
pairs = [] | |
for idx, num in enumerate(array): | |
comp_idx = seen.get(k-num, None) | |
if comp_idx is not None: | |
comp = array[comp_idx] | |
pair = (min(num, comp), max(num, comp)) | |
pairs.append(pair) | |
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
import json | |
from lxml import html | |
import pandas as pd | |
import random | |
import re | |
import requests as req | |
import time | |
base_url = 'https://lc-pro.ru' |