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 bs4 import BeautifulSoup | |
import urllib.request | |
def parse_html(soup_html, tag_name, class_name): | |
res = soup_html.find(tag_name, {"class": class_name}) | |
return res.contents[0].strip() | |
hemnet_url = 'https://www.hemnet.se/salda/bostader?location_ids%5B%5D=18031&item_types%5B%5D=bostadsratt&sold_age=all' | |
req = urllib.request.Request(hemnet_url, headers={'User-Agent': 'Mozilla/5.0'}) | |
fp = urllib.request.urlopen(req) |
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.*; | |
import java.io.*; | |
public class Solution { | |
public static void main(String[] args) { | |
Scanner sc = | |
new Scanner(new BufferedReader(new InputStreamReader(System.in))); | |
int T = sc.nextInt(); | |
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.*; | |
import java.io.*; | |
public class Solution { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in))); | |
int T = sc.nextInt(); | |
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 <algorithm> | |
#include <bitset> | |
#include <cassert> | |
#include <chrono> | |
#include <cstring> | |
#include <iomanip> | |
#include <iostream> | |
#include <map> | |
#include <queue> | |
#include <random> |
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.*; | |
import java.io.*; | |
public class Solution { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in))); | |
int T = sc.nextInt(); | |
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.*; | |
import java.io.*; | |
public class Solution { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in))); | |
int T = sc.nextInt(); | |
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.*; | |
import java.io.*; | |
import java.util.regex.*; | |
import java.awt.*; | |
import java.awt.geom.*; | |
public class Solution { | |
public static String robotPathDecoder_Stack(String input) { |
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 advent_day_seven_bag_content(statement): | |
so = statement.split(', ') | |
res = [] | |
for s in so: | |
s = s.replace('bags', '').replace('bag', '').replace('.', '') | |
s = s.lstrip().rstrip() | |
if s != 'no other': | |
pair = (s[2:], s[0]) | |
res.append(pair) | |
return res |
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 advent_day_8_pt2_solver(instructions): | |
N = len(instructions) | |
index = 0 | |
acc = 0 | |
visited = [] | |
candidates = [] | |
while index < N: | |
if index in visited: | |
return acc, candidates, False |
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 advent_day_9_pt2(nums, sum_to_find): | |
N = len(nums) | |
for i in range(N): | |
conta_set = [] | |
ts = nums[i] | |
conta_set.append(ts) | |
for k in range(i+1, N): | |
ts += nums[k] | |
conta_set.append(nums[k]) |
OlderNewer