Skip to content

Instantly share code, notes, and snippets.

@miyconst
Created February 25, 2025 11:26
Show Gist options
  • Save miyconst/07000f4f818fc0a4e4f24b05d1512a08 to your computer and use it in GitHub Desktop.
Save miyconst/07000f4f818fc0a4e4f24b05d1512a08 to your computer and use it in GitHub Desktop.
DeepSeek R1 AI Test code piece
// For YouTube video:
// https://youtu.be/UnPZHwVCQdo
public IEnumerable<T> Flatten(T parent)
where T : IParent
{
yield return parent;
foreach (T child in parent.Children)
{
foreach (T grand in Flatten(child))
yield return grand;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment