Behold the C# code:
IEnumerable<int> innerMethod(int parameter)
{
foreach(var i in Enumerable.Range(0, parameter))
{
yield return i;
}
}
IEnumerable<int> outerMethod(int parameter)
{
foreach(var i in Enumerable.Range(1, parameter))
{
foreach(var j in innerMethod(i))
{
yield return j;
}
}
}
The question is: There is a way for outerMethod have the same output without iterating over innerMethod output?