{"id":8649,"date":"2025-07-31T15:52:04","date_gmt":"2025-07-31T10:22:04","guid":{"rendered":"https:\/\/namastedev.com\/blog\/?p=8649"},"modified":"2025-07-31T16:46:58","modified_gmt":"2025-07-31T11:16:58","slug":"path-sum","status":"publish","type":"post","link":"https:\/\/namastedev.com\/blog\/path-sum\/","title":{"rendered":"Path Sum"},"content":{"rendered":"\n<!-- Path Sum -->\n<link\n    href=\"https:\/\/cdn.jsdelivr.net\/npm\/prismjs@1.29.0\/themes\/prism-tomorrow.min.css\"\n    rel=\"stylesheet\"\n\/>\n<script src=\"https:\/\/cdn.jsdelivr.net\/npm\/prismjs@1.29.0\/prism.min.js\"><\/script>\n<script src=\"https:\/\/cdn.jsdelivr.net\/npm\/prismjs@1.29.0\/plugins\/autoloader\/prism-autoloader.min.js\"><\/script>\n\n<style> \n.wp_blog_theme {\n  --primary: #E58C32;\n  --secondary: #f8c291;\n  --light-bg: #fef9f4;\n  --text-dark: #2d2d2d;\n  --tab-radius: 12px;\n  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);\n  --code-bg: #001f3f;\n  --code-text: #d4f1ff;\n}\n\n.wp_blog_container {\n  font-family: 'Segoe UI', sans-serif;\n  background: var(--light-bg);\n  margin: 0;\n  padding: 0;\n  color: var(--text-dark);\n}\n\n\/* Heading *\/\n.wp_blog_main-heading {\n  text-align: center;\n  font-size: 2.4rem;\n  color: var(--primary);\n  margin-top: 2.5rem;\n  font-weight: bold;\n}\n\n\/* Explanation Card *\/\n.wp_blog_explanation,\n.wp_blog_code-tabs-container {\n  max-width: 940px;\n  margin: 2rem auto;\n  padding: 2rem;\n  background: white;\n  border-radius: var(--tab-radius);\n  box-shadow: var(--shadow);\n}\n\n\/* Text and Visuals *\/\n.wp_blog_explanation h2{\n  font-size: 1.4rem;\n  color: var(--primary);\n  margin-bottom: 0.5rem;\n}\n.wp_blog_explanation h5{\n  color: var(--primary);\n}\n\n.wp_blog_explanation p,\n.wp_blog_explanation li {\n  font-size: 1.05rem;\n  line-height: 1.7;\n  margin: 0.5rem 0;\n}\n.wp_blog_explanation code {\n  background: #f9cea6;\n  color: #2d2d2d;\n  padding: 3px 6px;\n  border-radius: 4px;\n  font-family: 'Courier New', monospace;\n}\n.wp_blog_explanation img {\n  max-width: 100%;\n  border-radius: var(--tab-radius);\n  margin-top: 1rem;\n  box-shadow: 0 2px 12px rgba(0,0,0,0.06);\n}\n\n\/* Tab Buttons *\/\n.wp_blog_code-tabs-header {\n  display: flex;\n  flex-wrap: wrap;\n  gap: 0.5rem;\n  margin-bottom: 1rem;\n}\n.wp_blog_code-tab-button {\n  padding: 0.6rem 1.2rem;\n  border: 1px solid var(--primary);\n  background: white;\n  color: var(--primary);\n  border-radius: 50px;\n  font-weight: 600;\n  cursor: pointer;\n  transition: all 0.3s ease;\n}\n.wp_blog_code-tab-button:hover {\n  background: var(--secondary);\n}\n.wp_blog_code-tab-button.active {\n  background: var(--primary);\n  color: white;\n}\n\n\/* Code Content *\/\n.wp_blog_code-tab-content {\n  display: none;\n  background: var(--code-bg);\n  border-radius: var(--tab-radius);\n}\n.wp_blog_code-tab-content.active {\n  display: block;\n}\n.wp_blog_code-tab-content pre {\n  margin: 0;\n  padding: 1.5rem;\n  font-size: 1rem;\n  overflow-x: auto;\n  background: var(--code-bg);\n  border-radius: var(--tab-radius);\n  color: var(--code-text);\n}\n<\/style>\n\n<div class=\"wp_blog_container wp_blog_theme\"> \n    <h1 class=\"wp_blog_main-heading\"><\/h1>\n    <div class=\"wp_blog_explanation\">\n        <h2>Problem Statement:<\/h2>\n        <p>Given the <code>root<\/code> of a binary tree and an integer <code>targetSum<\/code>, return <code>true<\/code> if the tree has a <strong>root-to-leaf<\/strong> path such that adding up all the values along the path equals <code>targetSum<\/code>.<\/p>\n        <p>A <strong>leaf<\/strong> is a node with no children.<\/p>\n                <h2>Examples:<\/h2>\n\n                <h3>Example 1:<\/h3>\n                <img decoding=\"async\" src=\"https:\/\/namastedev.com\/blog\/wp-content\/uploads\/2025\/07\/Screenshot-2025-07-31-at-3.08.28\u202fPM.png\" alt=\"\">\n\n                <p><strong>Input:<\/strong> root = [5,4,8,11,null,13,4,7,2,null,null,null,1], targetSum = 22<\/p>\n                <p><strong>Output:<\/strong> true<\/p>\n                <p><strong>Explanation: <\/strong> The root-to-leaf path with the target sum is shown.<\/p>\n\n                <h3>Example 2:<\/h3>\n                <img decoding=\"async\" src=\"https:\/\/namastedev.com\/blog\/wp-content\/uploads\/2025\/07\/Screenshot-2025-07-31-at-3.08.33\u202fPM.png\" alt=\"\">\n                <p><strong>Input:<\/strong> root = [1,2,3], targetSum = 5<\/p>\n                <p><strong>Output:<\/strong> false<\/p>\n                <p><strong>Explanation: <\/strong>There are two root-to-leaf paths in the tree: <\/p>\n                 <ul>\n                    <li>(1 &#8211;> 2): The sum is 3.<\/li>\n                    <li>(1 &#8211;> 3): The sum is 4.<\/li>\n                    <li>There is no root-to-leaf path with sum = 5.<\/li>\n                 <\/ul>   \n\n                <h3>Example 3:<\/h3>\n                <p><strong>Input: <\/strong>root = [], targetSum = 0<\/p>\n                <p><strong>Output: <\/strong>false<\/p>\n                <p><strong>Explanation: <\/strong>Since the tree is empty, there are no root-to-leaf paths.<\/p>\n\n                    <h2>Constraints:<\/h2>\n                    <ul>\n                      <li>The number of nodes in the tree is in the range <code>[0, 5000]<\/code>.<\/li>\n                      <li><code>-1000 <= Node.val <= 1000<\/code><\/li>\n                      <li><code>-1000 <= targetSum <= 1000<\/code><\/li>\n                    <\/ul>\n\n                <h2>Approach 1: (Top-Down)<\/h2>\n                <ul>\n                    <li>At each node, we <strong>add the current node's<\/strong> value to the running sum <code>(currSum)<\/code>.<\/li>\n                    <li>If we reach a leaf node and the sum equals the <code>targetSum<\/code>, we update <code>ans = true<\/code>.<\/li>\n                    <li>We recursively check both left and right subtrees.<\/li>\n                <\/ul>\n\n                <h2>Time Complexity:<\/h2>\n                <li>\n                  <p><strong>Time Complexity = O(n)<\/strong>\n            \n                  <\/li>\n                <h2>Space Complexity:<\/h2>\n                <li>\n                  <p><strong>Space Complexity = O(n)<\/strong>\n                  <\/p>\n                <\/li>\n\n<h2>Dry Run<\/h2> <div style=\"background: #f9f9f9; border-left: 4px solid var(--primary); padding: 1rem; border-radius: var(--tab-radius); margin: 1rem 0;\"> <p><strong>Input:<\/strong> <code>root = [1, 2, 3, null, 4], targetSum = 7<\/code><\/p> <pre style=\"white-space: pre-wrap; background: #fff5ea; padding: 1rem; border-radius: 8px; overflow-x: auto;\"> \nTree Structure: \n        1 \n       \/ \\ \n      2   3 \n       \\\n        4\nStep-by-step Execution:\ntraverse(1, 0)\n\u2192 newSum = 0 + 1 = 1\n\u2192 traverse(2, 1)\n\u2192 newSum = 1 + 2 = 3\n\u2192 traverse(4, 3)\n\u2192 newSum = 3 + 4 = 7\n\u2192 Node 4 is a leaf and newSum == targetSum \u2192 ans = true\n\u2192 traverse(3, 1)\n\u2192 newSum = 1 + 3 = 4\n\u2192 Node 3 is a leaf and newSum != targetSum \u2192 do nothing\nFinal return value: true\n<\/pre>\n<p><strong>Output:<\/strong> <code>Result: true<\/code><\/p> <\/div>\n                <\/div>\n\n    <div class=\"wp_blog_code-tabs-container\">\n        <div class=\"wp_blog_code-tabs-header\">\n            <button class=\"wp_blog_code-tab-button active\" data-lang=\"js\">JavaScript<\/button>\n            <button class=\"wp_blog_code-tab-button\" data-lang=\"py\">Python<\/button>\n            <button class=\"wp_blog_code-tab-button\" data-lang=\"java\">Java<\/button>\n            <button class=\"wp_blog_code-tab-button\" data-lang=\"cpp\">C++<\/button>\n            <button class=\"wp_blog_code-tab-button\" data-lang=\"c\">C<\/button>\n            <button class=\"wp_blog_code-tab-button\" data-lang=\"cs\">C#<\/button>\n        <\/div>\n\n        <!-- JavaScript -->\n        <div class=\"wp_blog_code-tab-content active\" data-lang=\"js\">\n            <pre><code class=\"language-javascript\">\nvar hasPathSum = function(root, targetSum) {\n    if(!root) return false;\n    let ans = false;\n    let traverse = (curr, currSum) => {\n        let newSum = currSum + curr.val;\n        if(!curr.left && !curr.right) {\n            if(newSum === targetSum) {\n                ans = ans || true;\n            }\n        }\n        curr.left && traverse(curr.left, newSum);\n        curr.right && traverse(curr.right, newSum);\n    }\n    traverse(root, 0);\n    return ans;\n}; \n     <\/code><\/pre>\n        <\/div>\n\n        <!-- Python -->\n        <div class=\"wp_blog_code-tab-content\" data-lang=\"py\">\n            <pre><code class=\"language-python\">\nclass TreeNode:\n    def __init__(self, val=0, left=None, right=None):\n        self.val = val\n        self.left = left\n        self.right = right\ndef hasPathSum(root, targetSum):\n    if not root:\n        return False\n    ans = [False]  # using list to allow updates inside nested function\n    def traverse(curr, currSum):\n        newSum = currSum + curr.val\n        if not curr.left and not curr.right:\n            if newSum == targetSum:\n                ans[0] = True\n        if curr.left:\n            traverse(curr.left, newSum)\n        if curr.right:\n            traverse(curr.right, newSum)\n    traverse(root, 0)\n    return ans[0]\n            <\/code><\/pre>\n        <\/div>\n\n        <!-- Java -->\n        <div class=\"wp_blog_code-tab-content\" data-lang=\"java\">\n            <pre><code class=\"language-java\">\nclass TreeNode {\n    int val;\n    TreeNode left;\n    TreeNode right;\n}\nclass Solution {\n    boolean ans = false;\n    public boolean hasPathSum(TreeNode root, int targetSum) {\n        if (root == null) return false;\n\n        traverse(root, 0, targetSum);\n        return ans;\n    }\n    private void traverse(TreeNode curr, int currSum, int targetSum) {\n        int newSum = currSum + curr.val;\n        if (curr.left == null && curr.right == null) {\n            if (newSum == targetSum) {\n                ans = true;\n            }\n        }\n        if (curr.left != null) traverse(curr.left, newSum, targetSum);\n        if (curr.right != null) traverse(curr.right, newSum, targetSum);\n    }\n}\n     <\/code><\/pre>\n        <\/div>\n\n        <!-- C++ -->\n        <div class=\"wp_blog_code-tab-content\" data-lang=\"cpp\">\n            <pre><code class=\"language-cpp\">\nstruct TreeNode {\n    int val;\n    TreeNode* left;\n    TreeNode* right;\n};\nbool hasPathSum(TreeNode* root, int targetSum) {\n    if (!root) return false;\n    bool ans = false;\n    std::function<void(TreeNode*, int)> traverse = [&](TreeNode* curr, int currSum) {\n        int newSum = currSum + curr->val;\n        if (!curr->left && !curr->right) {\n            if (newSum == targetSum) {\n                ans = true;\n            }\n        }\n        if (curr->left) traverse(curr->left, newSum);\n        if (curr->right) traverse(curr->right, newSum);\n    };\n    traverse(root, 0);\n    return ans;\n}\n  <\/code><\/pre>\n        <\/div>\n\n        <!-- C -->\n        <div class=\"wp_blog_code-tab-content\" data-lang=\"c\">\n            <pre><code class=\"language-c\">\n#include &lt;stdbool.h&gt;\nstruct TreeNode {\n    int val;\n    struct TreeNode* left;\n    struct TreeNode* right;\n};\nvoid traverse(struct TreeNode* curr, int currSum, int targetSum, bool* ans) {\n    if (!curr) return;\n    int newSum = currSum + curr->val;\n    if (!curr->left && !curr->right) {\n        if (newSum == targetSum) {\n            *ans = true;\n        }\n    }\n    if (curr->left) traverse(curr->left, newSum, targetSum, ans);\n    if (curr->right) traverse(curr->right, newSum, targetSum, ans);\n}\nbool hasPathSum(struct TreeNode* root, int targetSum) {\n    if (!root) return false;\n    bool ans = false;\n    traverse(root, 0, targetSum, &ans);\n    return ans;\n}   <\/code><\/pre>\n        <\/div>\n\n        <!-- C# -->\n        <div class=\"wp_blog_code-tab-content\" data-lang=\"cs\">\n            <pre><code class=\"language-csharp\">\npublic class TreeNode {\n    public int val;\n    public TreeNode left;\n    public TreeNode right;\n}\npublic class Solution {\n    public bool HasPathSum(TreeNode root, int targetSum) {\n        if (root == null) return false;\n        bool ans = false;\n        void Traverse(TreeNode curr, int currSum) {\n            int newSum = currSum + curr.val;\n            if (curr.left == null && curr.right == null) {\n                if (newSum == targetSum) {\n                    ans = true;\n                }\n            }\n            if (curr.left != null) Traverse(curr.left, newSum);\n            if (curr.right != null) Traverse(curr.right, newSum);\n        }\n        Traverse(root, 0);\n        return ans;\n    }\n}\n            <\/code><\/pre>\n        <\/div>\n    <\/div>\n<\/div>\n\n<!-- Approach 2:  -->\n  <div class=\"wp_blog_container wp_blog_theme\"> \n    <h1 class=\"wp_blog_main-heading\"><\/h1>\n    <div class=\"wp_blog_explanation\">\n\n        <h2>Approach 2: Bottom Up<\/h2>\n            <ul>\n                <li><strong>Base Case: <\/strong>\n                <ul>\n                    <li>If the node is <code>null<\/code>, return <code>false<\/code>.<\/li>\n                    <li>If it\u2019s a <strong>leaf node<\/strong> (no left or right child), check if <code>node.val === targetSum<\/code>.<\/li>\n                <\/ul>\n                <\/li>\n\n                <li><strong>Recursive Case: <\/strong>\n                <ul>\n                    <li>Subtract the current node's value from <code>targetSum<\/code>.<\/li>\n                    <li>Recursively check left and right subtrees with the updated sum.<\/li>\n                <\/ul>\n                <\/li>\n\n                <li><strong>Return:<\/strong>\n                <ul>\n                    <li>Return <code>true<\/code> if <strong>any<\/strong> path in left or right subtree matches the condition.\n<\/li>\n                <\/ul>\n                <\/li>\n            <\/ul>\n                    <h2>Time Complexity:<\/h2>\n                    <li>\n                      <p><strong>Time Complexity = O(n)<\/strong>\n                      <\/li>\n                    <h2>Space Complexity:<\/h2>\n                    <li>\n                      <p><strong>Space Complexity = O(n)<\/strong> <\/p>\n\n                    <\/li>\n\n<h2>Dry Run<\/h2>\n<div style=\"background: #f9f9f9; border-left: 4px solid var(--primary); padding: 1rem; border-radius: var(--tab-radius); margin: 1rem 0;\">\n<p><strong>Input:<\/strong> <code>root = [1, 2, 3, null, 4], targetSum = 7<\/code><\/p>\n<pre style=\"white-space: pre-wrap; background: #fff5ea; padding: 1rem; border-radius: 8px; overflow-x: auto;\">\n  1\n \/ \\\n2   3\n \\\n  4\n\nRecursive Calls:\n\u2192 hasPathSum(1, 7)\n   \u2192 node is not null and not a leaf\n   \u2192 leftSubTreeHasPathSum = hasPathSum(2, 6)\n       \u2192 node is not null and not a leaf\n       \u2192 leftSubTreeHasPathSum = hasPathSum(null, 4) = false\n       \u2192 rightSubTreeHasPathSum = hasPathSum(4, 4)\n           \u2192 node is a leaf\n           \u2192 root.val === targetSum \u2192 4 === 4 \u2192 true\n       \u2192 return true\n   \u2192 rightSubTreeHasPathSum = hasPathSum(3, 6)\n       \u2192 node is a leaf\n       \u2192 root.val === targetSum \u2192 3 === 6 \u2192 false\n   \u2192 return true || false \u2192 true\n<\/pre>\n<p><strong>Output:<\/strong> <code>Result: true<\/code><\/p>\n<\/div>\n\n<\/div>\n    <div class=\"wp_blog_code-tabs-container\">\n        <div class=\"wp_blog_code-tabs-header\">\n            <button class=\"wp_blog_code-tab-button active\" data-lang=\"js\">JavaScript<\/button>\n            <button class=\"wp_blog_code-tab-button\" data-lang=\"py\">Python<\/button>\n            <button class=\"wp_blog_code-tab-button\" data-lang=\"java\">Java<\/button>\n            <button class=\"wp_blog_code-tab-button\" data-lang=\"cpp\">C++<\/button>\n            <button class=\"wp_blog_code-tab-button\" data-lang=\"c\">C<\/button>\n            <button class=\"wp_blog_code-tab-button\" data-lang=\"cs\">C#<\/button>\n        <\/div>\n\n        <!-- JavaScript -->\n        <div class=\"wp_blog_code-tab-content active\" data-lang=\"js\">\n            <pre><code class=\"language-javascript\">\nvar hasPathSum = function(root, targetSum) {\n    if(!root) return false;\n    if(!root.left && !root.right) {\n        return root.val === targetSum;\n    } \n    let leftSubTreeHasPathSum = hasPathSum(root.left, targetSum - root.val);\n    let rightSubTreeHasPathSum = hasPathSum(root.right, targetSum - root.val);\n\n    return leftSubTreeHasPathSum || rightSubTreeHasPathSum;\n};\n            <\/code><\/pre>\n        <\/div>\n\n        <!-- Python -->\n        <div class=\"wp_blog_code-tab-content\" data-lang=\"py\">\n            <pre><code class=\"language-python\">\ncdef hasPathSum(root, targetSum):\n    if not root:\n        return False\n    if not root.left and not root.right:\n        return root.val == targetSum\n    left = hasPathSum(root.left, targetSum - root.val)\n    right = hasPathSum(root.right, targetSum - root.val)\n    return left or right\n            <\/code><\/pre>\n        <\/div>\n\n        <!-- Java -->\n        <div class=\"wp_blog_code-tab-content\" data-lang=\"java\">\n            <pre><code class=\"language-java\">\npublic boolean hasPathSum(TreeNode root, int targetSum) {\n    if (root == null) return false;\n    if (root.left == null && root.right == null) {\n        return root.val == targetSum;\n    }\n    boolean left = hasPathSum(root.left, targetSum - root.val);\n    boolean right = hasPathSum(root.right, targetSum - root.val);\n    return left || right;\n}   <\/code><\/pre>\n        <\/div>\n\n        <!-- C++ -->\n        <div class=\"wp_blog_code-tab-content\" data-lang=\"cpp\">\n            <pre><code class=\"language-cpp\">\nbool hasPathSum(TreeNode* root, int targetSum) {\n    if (root == nullptr) return false;\n    if (root->left == nullptr && root->right == nullptr) {\n        return root->val == targetSum;\n    }\n    bool left = hasPathSum(root->left, targetSum - root->val);\n    bool right = hasPathSum(root->right, targetSum - root->val);\n    return left || right;\n}\n <\/code><\/pre>\n        <\/div>\n\n        <!-- C -->\n        <div class=\"wp_blog_code-tab-content\" data-lang=\"c\">\n            <pre><code class=\"language-c\">\nbool hasPathSum(struct TreeNode* root, int targetSum) {\n    if (root == NULL) return false;\n    if (root->left == NULL && root->right == NULL) {\n        return root->val == targetSum;\n    }\n    bool left = hasPathSum(root->left, targetSum - root->val);\n    bool right = hasPathSum(root->right, targetSum - root->val);\n    return left || right;\n}\n<\/code><\/pre>\n        <\/div>\n\n        <!-- C# -->\n        <div class=\"wp_blog_code-tab-content\" data-lang=\"cs\">\n            <pre><code class=\"language-csharp\">\npublic bool HasPathSum(TreeNode root, int targetSum) {\n    if (root == null) return false;\n    if (root.left == null && root.right == null) {\n        return root.val == targetSum;\n    }\n    bool left = HasPathSum(root.left, targetSum - root.val);\n    bool right = HasPathSum(root.right, targetSum - root.val);\n    return left || right;\n}\n      <\/code><\/pre>\n        <\/div>\n    <\/div>\n<\/div>\n\n<script>\n    document.addEventListener(\"DOMContentLoaded\", () => {\n        const buttons = document.querySelectorAll(\".wp_blog_code-tab-button\");\n        const contents = document.querySelectorAll(\".wp_blog_code-tab-content\");\n\n        buttons.forEach((button) => {\n            button.addEventListener(\"click\", () => {\n                const lang = button.getAttribute(\"data-lang\");\n\n                buttons.forEach((btn) => btn.classList.remove(\"active\"));\n                contents.forEach((content) =>\n                    content.classList.remove(\"active\")\n                );\n\n                button.classList.add(\"active\");\n                document\n                    .querySelector(`.wp_blog_code-tab-content[data-lang=\"${lang}\"]`)\n                    .classList.add(\"active\");\n            });\n        });\n    });\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>Problem Statement: Given the root of a binary tree and an integer targetSum, return true if the tree has a root-to-leaf path such that adding up all the values along the path equals targetSum. A leaf is a node with no children. Examples: Example 1: Input: root = [5,4,8,11,null,13,4,7,2,null,null,null,1], targetSum = 22 Output: true Explanation:<\/p>\n","protected":false},"author":108,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[210,322,176,175,211,174,172,173],"tags":[],"class_list":["post-8649","post","type-post","status-publish","format-standard","category-algorithms","category-algorithms-and-data-structures","category-csharp","category-cplusplus","category-data-structures","category-java","category-javascript","category-python"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/namastedev.com\/blog\/wp-json\/wp\/v2\/posts\/8649","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/namastedev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/namastedev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/namastedev.com\/blog\/wp-json\/wp\/v2\/users\/108"}],"replies":[{"embeddable":true,"href":"https:\/\/namastedev.com\/blog\/wp-json\/wp\/v2\/comments?post=8649"}],"version-history":[{"count":2,"href":"https:\/\/namastedev.com\/blog\/wp-json\/wp\/v2\/posts\/8649\/revisions"}],"predecessor-version":[{"id":8753,"href":"https:\/\/namastedev.com\/blog\/wp-json\/wp\/v2\/posts\/8649\/revisions\/8753"}],"wp:attachment":[{"href":"https:\/\/namastedev.com\/blog\/wp-json\/wp\/v2\/media?parent=8649"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/namastedev.com\/blog\/wp-json\/wp\/v2\/categories?post=8649"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/namastedev.com\/blog\/wp-json\/wp\/v2\/tags?post=8649"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}