Skip to content

Add verify_order function #9

@ChainsManipulator

Description

@ChainsManipulator

verify_order function should take one-dimentional array and return boolean flag indicating whether given array is a valid order.

Examples:

a = []
b = verify_order(a)
print(b) 
>>> True

a = [0, 1, 1, 2, 1, 1, 1, 0 , 2]
b = verify_order(a)
print(b) 
>>> True

a = [0, 2, 1]
b = verify_order(a)
print(b) 
>>> False

a = [0, 1, 3]
b = verify_order(a)
print(b) 
>>> False

a = [0, 'a', 1]
b = verify_order(a)
print(b) 
>>> False

a = [1, 2, 3]
b = verify_order(a)
print(b) 
>>> False

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions