You need to log in or create an account to post to this user's Wall.
@sn, wrong solution, try @jgan’s test case, your method will lead to WA!
jgan commented on the post, Regular Expression Matching 7 months, 3 weeks ago
here, definition of ‘*’ is confusing, a*b could equal to following strings?
b–>cancel a
ab–>0 a
aab–>1 a
aaab–>2 a
aaaab–>3 a
…jgan joined the group Palantir Interview 9 months, 3 weeks ago
jgan commented on the post, Construct Binary Tree From Inorder and Preorder/Postorder Traversal 9 months, 3 weeks ago
Hi 1337c0d3r, if duplicates are allowed, is it possible to build a binary tree from Inorder and Preorder/Postorder Traversal ?
test case: {3,6,1000,5,1,2,4}
@AG:
you need a while loop in the first scan, check code below
int find1stabsence(vector& num)
{
int size = num.size();
for(int i = 0;i size;i++)
{
while(num[i] != i + 1 && num[i] = […]jgan joined the group Amazon Interview 9 months, 4 weeks ago
@sn, it’s not linear time solution, since for each element in array, you may need to swap for couple times.
jgan became a registered member 9 months, 4 weeks ago
