-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
102 lines (100 loc) · 3.2 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# from braille import braille_translator
# from chessboard import answer
# from route_salute import answer
# from fuel_injection import answer
# from bomb import answer
# from access_code import answer
# from bunny_prison import answer
# from running_bunnies import answer
# from running_with_bunnies_4_2 import solution
# from bringing_a_gun_to_a_gourd_fight_4_3 import solution
# from minion_task_scheduling_1 import solution
# from numbers_station_coded_messages_2_1 import solution
# from the_grandest_staircase_of_them_all_3_3 import solution
# from a_pirate_walks_into_a_bar_3_1 import solution
# from count_connected_components import solution
# from grid_zero_4_1 import solution
# from hey_i_already_did_that_2_1 import solution
# from solar_doomsday_1 import solution
# from doomsday_fuel_3_1 import solution
# from re_id_1_real import solution
# from do_not_get_volunteered_2_1_real import solution
# from please_pass_the_coded_messages_2_2_real import solution
# from find_the_access_codes_3_1_real import solution
# from the_grandest_staircase_of_them_all_3_2_real import solution
from doomsday_fuel_3_3_real import solution
if __name__ == '__main__':
# 1
# print(braille_translator('The quick brown fox jumps over the lazy dog'))
# 2.1
# print(answer(0,1))
# 2.2
# print(answer(">----<"))
# 3.1
# print(answer("855"))
# 3.2
# print(answer("14", "17"))
# 3.3
# print(answer([1, 2, 3, 4, 5, 6]))
# 4.1
# print(answer(2, 1))
# print(answer(5, 3))
# print(answer(4, 4))
# 4.2
# print(solution.answer([
# [0, 1, 1, 1, 1],
# [1, 0, 1, 1, 1],
# [1, 1, 0, 1, 1],
# [1, 1, 1, 0, 1],
# [1, 1, 1, 1, 0]
# ], 3))
# 4.3
# Example usage:
# dimensions = [3, 2]
# your_position = [1, 1]
# guard_position = [2, 1]
# distance = 4
#
# result = solution.answer([3,2], [1,1], [2,1], 4)
# print(result)
# 1
# print(solution.answer([1, 2, 2, 3, 3, 3, 4, 5, 5], 1))
# 2.1
# print(solution.answer([7,4,3,5,8], 12))
# 3.3
# print(solution.answer(8))
# 3.1
# print(solution.answer([1, 3, 0, 1]))
# print(solution.answer([1, 3, 4, 1, 2]))
# dfs practice:
# graph = {
# 0: [1, 2],
# 1: [0, 2],
# 2: [0, 1],
# 3: [4],
# 4: [3]
# }
#
# result = solution.count_connected_components(graph)
# print("Number of connected components:", result)
# 4.1
# print(solution.answer([[1, 1], [0, 0]]))
# 2.1
# print(solution.answer('210022', 3))
# 1
# print(solution.answer(15324))
# 3.1
# print(solution.answer([[0, 2, 1, 0, 0], [0, 0, 0, 3, 4], [0, 0, 0, 0, 0], [0, 0, 0, 0,0], [0, 0, 0, 0, 0]]))
# real challenge
# 1
# print(solution.solution(10000))
# 2_1
# print(solution.solution(19, 36))
# 2_2
# print(solution.solution([3, 1, 4, 1, 5, 9]))
# 3_1
# print(solution.solution([1, 2, 3, 4, 5, 6]))
# 3_2
# print(solution.solution(200))
# 3_3
print(solution.solution([[0, 1, 0, 0, 0, 1], [4, 0, 0, 3, 2, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]]))