shorter code
This commit is contained in:
parent
5541e7a88a
commit
06ff6449c3
1 changed files with 2 additions and 3 deletions
|
|
@ -9,9 +9,8 @@ class Rule(NamedTuple):
|
||||||
|
|
||||||
|
|
||||||
def is_rule_satisfied(in_list: list, rule: Rule) -> bool:
|
def is_rule_satisfied(in_list: list, rule: Rule) -> bool:
|
||||||
child_val, parent_val = rule
|
child_index = in_list.index(rule.child)
|
||||||
child_index = in_list.index(child_val)
|
parent_index = in_list.index(rule.parent)
|
||||||
parent_index = in_list.index(parent_val)
|
|
||||||
return parent_index < child_index
|
return parent_index < child_index
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue