Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
n th to last element
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { if (head == null) throw new Exception("Empty linked list"); if (x < 1) throw new Exception("Index out of range"); Node lag = head; Node lead = head; //Move the lead pointer up (x-1 positions) while leaving the lag pointer behind for (int i = 1; i < x; i++) lead = lead.Next; //Move the lag and lead pointers up one at a time until the lead is at the end of the list while (lead.Next != null) { lag = lag.Next; lead = lead.Next; } return lag.Data; } } }
run
|
edit
|
history
|
help
0
dsfafasd
Const
two words are anagrams
valida fechas sura
10
sdefuy6j87uytgraxsd
asxsadaxsdf
WebScrape using Regex
CancellationToken Struct dot net
D110