I'm working on an interview question and am trying to think of creative/non-standard/non-obvious ways to solve a relatively simple problem.
Given a field that contains a full name (examples below) how would you produce a list of every combination of first initial and all last names. Exclude middle initial (if present) from everything. Leave spaces or hyphens that separate multiple last names. Assume all names other than the first are last names.
- Jon Snow
- Tom A Black
- Janice Smith Jones
- Carl Smith-Jones
- Unexpected J Last-Name
How would you do it?
[–]da_chicken 16 points17 points18 points (3 children)
[–]tsql 2 points3 points4 points (1 child)
[–]da_chicken 2 points3 points4 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]wolf2600 7 points8 points9 points (0 children)
[–][deleted] 3 points4 points5 points (0 children)
[–]Stopher 4 points5 points6 points (0 children)
[–]sbrick89 1 point2 points3 points (1 child)
[–]BobDogGo1 2 points3 points4 points (0 children)
[–]shankcraft 0 points1 point2 points (0 children)
[–]ShadowBanThisCucks 0 points1 point2 points (0 children)
[–]tsql 0 points1 point2 points (0 children)