Dimentrix Interview Question

logic based programing question