LexCheck Interview Question

Was asked to solve two coding problems