givne two linked list:
L1 : 1->2->3->4->5
L2 : 3->4->5
find longest common sublist from list end , like above example , the ans is :
3->4->5
O(1) space and not to reverse the linked list.
givne two linked list:
L1 : 1->2->3->4->5
L2 : 3->4->5
find longest common sublist from list end , like above example , the ans is :
3->4->5
O(1) space and not to reverse the linked list.
Stream: backiuwcatbeforewerehpqojf
Input: [“back”, “before”, “cat”, “fore”, “were”, “for”]
Output: [0, 10, 7, 12, 16, 12]
Generator: char getNextChar();
Given random stream input , like above backiuwcatbeforewerehpqojf, you can only use getNextChar() to get next char in the tream , for a list of input words ( ex : [“back”, “before”, “cat”, fore", “were”, “for”] ), find each word position in the stream.