Pattern Glob Matching - Coding problem | OneNoughtOne