This file contains hidden or 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
{ | |
"options": [ | |
{ | |
"name": "Hotel Amaryllis", | |
"description": "Hotel **Amaryllis** v **Thameli** ponúka **bezplatné parkovanie s obsluhou** a **nočný klub**. K dispozícii sú aj **reštaurácia**, **bary** a **obchod s kávou**, pričom hostia môžu využiť aj **bezplatné WiFi** a **wellness služby**.", | |
"search_term": "Hotel Amaryllis", | |
"price_range": { | |
"min": 23.32, | |
"max": 34.98, | |
"type": "range" |
This file contains hidden or 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 sum_intervals(interval_list): | |
interval_list.sort(key=lambda lst: lst[0]) | |
# sum numbers in the interval with the lowest begin number | |
begin, end = interval_list[0] | |
max = end | |
result = sum(range(begin, end + 1)) | |
# sum numbers from the remaining intervals | |
for begin, end in interval_list[1:]: |