For example:
Given 1->2->3->4->5->NULL and k = 2,
return 4->5->1->2->3->NULL.
Idea:
- link the tail to head to construct a circle
- start from head until stop by total - (k%total)
- set tail.next to null to break the circle
/**
* SyntaxHighlighter
*/
function foo()
{
if (counter <= 10)
return;
// it works!
}
/**
* SyntaxHighlighter
*/
function foo()
{
if (counter <= 10)
return;
// it works!
}
Change to the theme you would like to use, for example: