-
Notifications
You must be signed in to change notification settings - Fork 371
Closed
Description
LeetCode Username
harshitaverma2343
Problem Number, Title, and Link
- 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