Route by Extension
Medium · Conditionals · case · Globbing
Problem
A filename arrives as the first argument. Print what kind of file it is:
- text for .txt
- image for .png or .jpg
- unknown for anything else
Approaches
- case with glob patterns
Related problems
Start free on Cariara · Coding problems · System design studio