Skip to content

Missing Test Case - 1484. Linked List in Binary Tree #29151

@vHarshita15

Description

@vHarshita15

LeetCode Username

harshitaverma2343

Problem Number, Title, and Link

  1. Linked List in Binary Tree

Bug Category

Incorrect test case (Output of test case is incorrect as per the problem statement)

Bug Description

Internal Error
You've found a test case the system can't handle. Thank you!

Language Used for Code

None

Code used for Submit/Run operation

class Solution {
public:
bool check(ListNode* head,TreeNode* root){
    if(head == NULL)
        return true;
    
    if( root == NULL)
        return false;
    

if( head->val != root->val){
    return false;
}
return check(head->next , root->left) || check(head->next , root->right);
}

    bool isSubPath(ListNode* head, TreeNode* root) {
       if( root == NULL){
        return false;
       } 

   return check(head,root)|| isSubPath(head,root->left)||isSubPath(head,  root->right);



    }
};

Expected behavior

ALL TEST CASES MUST BE PASSED

Screenshots

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions