From 3c4229fc9e0ec6da9a7f60b57b9e93c49d1b6b6c Mon Sep 17 00:00:00 2001 From: L0P0P Date: Thu, 27 Jun 2024 12:02:35 +0200 Subject: Fixed a lot of problems from all the progs we need to parse --- progs/a284.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'progs/a284.py') diff --git a/progs/a284.py b/progs/a284.py index b69395b..cfd429d 100644 --- a/progs/a284.py +++ b/progs/a284.py @@ -1,11 +1,13 @@ -def is_Isomorphic(str1,str2): - dict_str1 = {} - dict_str2 = {} - for i, value in enumerate(str1): - dict_str1[value] = dict_str1.get(value,[]) + [i] - for j, value in enumerate(str2): - dict_str2[value] = dict_str2.get(value,[]) + [j] - if sorted(dict_str1.values()) == sorted(dict_str2.values()): - return True - else: - return False \ No newline at end of file +# FIXME: multiple variable assignment in for loop +# +# def is_Isomorphic(str1,str2): +# dict_str1 = {} +# dict_str2 = {} +# for i, value in enumerate(str1): +# dict_str1[value] = dict_str1.get(value,[]) + [i] +# for j, value in enumerate(str2): +# dict_str2[value] = dict_str2.get(value,[]) + [j] +# if sorted(dict_str1.values()) == sorted(dict_str2.values()): +# return True +# else: +# return False \ No newline at end of file -- cgit v1.2.3-18-g5258