I’m learning C# by reading a books and other online tutorials (homeandlearn.co.uk)
I’ve managed to do the FizzBuzz excercise but struggling with the below excercise. Any help would be much much appreciated.
Please explain in detail so i can learn aswell.
Excercise
filter a list of strings that should pass only six letter strings that are composed of two concatenated smaller strings that are also in the list.
For example, given the list
acks, top, cat, gr, by, bar,lap, st, ely, ades
The list should return
stacks, laptop, grades, barely
Because these are a concatenation of two other strings:
st + acks = stacks
lap + top = laptop
gr + ades = grades
bar + ely = barely
There really are a lot of ways to do this. Here’s one that uses pairing: