Example code from lc demonstrating search and sort