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
require 'net/http' | |
require 'date' | |
require 'logger' | |
require 'socket' | |
begin | |
require 'openssl' | |
BaseSSLError = OpenSSL::SSL::SSLError |
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
my_list = [(7,9),(8,10),(13,17)] | |
def check_free_time(my_list): | |
free_time = [] | |
my_list.sort() | |
if my_list[0][0] > 0: #if the first meeting is not at midnight | |
t = (0, my_list[0][0]) | |
free_time.append(t) |
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 ascending_order(my_list): | |
length_list = len(my_list) - 1 | |
sorted = False | |
while not sorted: | |
sorted = True | |
for i in range(length_list): | |
if my_list[i][1] > my_list[i+1][1]: | |
sorted = False | |
my_list[i], my_list[i+1] = my_list[i+1], my_list[i] | |
return my_list |
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
my_list = [3,5,4,8,3,2,1,6,11] | |
#todo | |
#implement ascending order here | |
def ascending_order(my_list): | |
length_list = len(my_list) - 1 | |
sorted = False | |
while not sorted: | |
sorted = True | |
for i in range(length_list): |