You are viewing a single comment's thread. Return to all comments →
Here's it in 3 lines of C#:
static IEnumerable<int> LastValues(int n, int a, int b) { int floor = Math.Min(a,b) * (n - 1), diff = Math.Abs(b - a); return Enumerable.Range(0, n).Select(i => floor + diff * i).Distinct(); }
Manasa and Stones
You are viewing a single comment's thread. Return to all comments →
Here's it in 3 lines of C#: