-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLCS.py
More file actions
42 lines (36 loc) · 966 Bytes
/
LCS.py
File metadata and controls
42 lines (36 loc) · 966 Bytes
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
# Author: Jingze Dai
# Email Address: [email protected] or [email protected]
# Github: https://github.com/daijingz
# Linkedin: https://www.linkedin.com/in/jingze-dai/
# Description: LCS Problem
class Table:
def __init__(self, x: int, y: int):
if x <= 0 or y <= 0:
raise Exception()
self.__x = x
self.__y = y
self.__body = []
i, j = 0, 0
while i < x:
arr = []
while j < y:
arr += [None]
j += 1
j = 0
self.__body += [arr]
i += 1
def get_x(self):
try:
return self.__x
except:
raise Exception()
def get_y(self):
try:
return self.__y
except:
raise Exception()
def get_body(self):
try:
return self.__body
except:
raise Exception()