Here is the template for deep equals of objects through rtti. You can expand it or customize

unit DeepEquals; interface uses classes, rtti; type TObjectHelpers

Читать на сайте автора.

Delphi.Serialization with neon lib

I used neon library, below the example

here is github of my test of this library, lib works nice !!!

how to use? download sources

Читать на сайте автора.


optimal solution

public ListNode Reverse(ListNode head){ var node = head; ListNode prev = null; while(node != null){ var next =; = prev;

Читать на сайте автора.


To avoid border cases we can create a fake or how it is called sentinel node

public void DoSmth(ListNode head) { ListNode fakeNode = new

Читать на сайте автора.


basic approach is to change connection =

  1. RemoveElements(ListNode head, int val)

leetcode task

optimal solution through sentinel or fake node

Читать на сайте автора.