{"id":10189,"date":"2025-09-30T15:02:14","date_gmt":"2025-09-30T09:32:14","guid":{"rendered":"https:\/\/namastedev.com\/blog\/?p=10189"},"modified":"2026-04-30T20:16:00","modified_gmt":"2026-04-30T14:46:00","slug":"decode-ways","status":"publish","type":"post","link":"https:\/\/namastedev.com\/blog\/decode-ways\/","title":{"rendered":"Decode Ways"},"content":{"rendered":"\n<!-- PrismJS for Syntax Highlighting -->\n<link href=\"https:\/\/cdn.jsdelivr.net\/npm\/prismjs@1.29.0\/themes\/prism-tomorrow.min.css\" rel=\"stylesheet\">\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: #030302;\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\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\n.wp_blog_explanation code {\n  background: #fef9f4;   \/* light bg instead of dark blue *\/\n  color: #E58C32;        \/* brand orange *\/\n  padding: 3px 6px;\n  border-radius: 4px;\n  font-family: 'Courier New', monospace;\n  font-weight: 600;      \/* optional, makes it pop *\/\n}\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\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\n.wp_blog_code-tab-button:hover {\n  background: var(--secondary);\n}\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\n.wp_blog_code-tab-content.active {\n  display: block;\n}\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\n\/* Dark mode variables *\/\n.wp_blog_theme.dark-mode {\n  --light-bg: #121212;\n  --text-dark: #f5f5f5;\n  --shadow: 0 4px 12px rgba(255, 255, 255, 0.08);\n  --code-bg: #1e1e1e;\n  --code-text: #c5f0ff;\n}\n\n.wp_blog_theme.dark-mode .wp_blog_explanation {\n  background: #1e1e1e;\n}\n\n\/* Dark mode code highlight *\/\n.wp_blog_theme.dark-mode .wp_blog_explanation code {\n  background: #333;\n  color: #ffd27f;\n}\n\n.wp_blog_theme {\n  position: relative; \/* makes it the reference for absolute children *\/\n}\n\n.wp_blog_toggle-btn {\n  position: absolute;\n  top: 1rem;\n  right: 1rem;\n  z-index: 9999;\n  padding: 0.5rem 0.8rem;\n  border-radius: 10%;\n  background: var(--primary);\n  color: white;\n  font-weight: bold;\n  cursor: pointer;\n  border: none;\n  box-shadow: var(--shadow);\n  transition: background 0.3s, transform 0.2s;\n}\n\n.wp_blog_toggle-btn:hover {\n  background: #cc772e;\n}\n\n.wp_blog_theme.dark-mode .wp_blog_code-tabs-container {\n  background: #1e1e1e;\n}\n<\/style>\n\n<div class=\"wp_blog_container wp_blog_theme\">\n  <button id=\"blogNotesThemeToggle\" class=\"wp_blog_toggle-btn\">\ud83c\udf19<\/button>\n  <h1 class=\"wp_blog_main-heading\"><\/h1>\n\n  <div class=\"wp_blog_explanation\">\n    <h2>Problem Statement:<\/h2>\n    <p>\n        You have intercepted a secret message encoded as a string of numbers. The message is <strong>decoded<\/strong> via the following mapping:\n    <\/p>\n    <pre>\n            \"1\" -> 'A'\n            \"2\" -> 'B'\n            ...\n            \"25\" -> 'Y'\n            \"26\" -> 'Z'\n    <\/pre>\n\n    <p>\n        However, while decoding the message, you realize that there are many different ways you can decode the message because some codes are contained in other codes (<code>\"2\"<\/code> and <code>\"5\"<\/code> vs code&#8221;25&#8243;).\n    <\/p>\n\n    <p>For example, <code>\"11106\"<\/code> can be decoded into:<\/p>\n    <ul>\n        <li><code><code>\"AAJF\"<\/code> with the grouping <code>(1, 1, 10, 6)<\/code><\/code><\/li>\n        <li><code>\"KJF\"<\/code> with the grouping <code>(11, 10, 6)<\/code><\/li>\n        <li>The grouping <code>(1, 11, 06)<\/code> is invalid because <code>\"06\"<\/code> is not a valid code (only <code>\"6\"<\/code> is valid).<\/li>\n    <\/ul>\n\n    <p>\n        Note: there may be strings that are impossible to decode.\n    <\/p>\n\n    <p>\n        Given a string s containing only digits, return the <code>number of ways<\/code> to <strong>decode<\/strong> it. If the entire string cannot be decoded in any valid way, return <code>0<\/code>.\n    <\/p>\n\n    <p>\n        The test cases are generated so that the answer fits in a <code>32-bit <\/code>integer.\n    <\/p>\n\n    <h3>Example 1:<\/h2>\n    <p><strong>Input:<\/strong> s = &#8220;12&#8221;<\/p>\n    <p><strong>Output:<\/strong> &#8220;12&#8221;<\/p>\n    <p><strong>Explanation:<\/strong> &#8220;12&#8221; could be decoded as &#8220;AB&#8221; (1 2) or &#8220;L&#8221; (12).<\/p>\n\n    <h3>Example 2:<\/h2>\n    <p><strong>Input:<\/strong> s = &#8220;226&#8221;<\/p>\n    <p><strong>Output:<\/strong> 3<\/p>\n    <p><strong>Explanation:<\/strong> &#8220;226&#8221; could be decoded as &#8220;BZ&#8221; (2 26), &#8220;VF&#8221; (22 6), or &#8220;BBF&#8221; (2 2 6).<\/p>\n\n    <h3>Example 3:<\/h2>\n    <p><strong>Input:<\/strong> s = &#8220;06&#8221;<\/p>\n    <p><strong>Output:<\/strong> 0<\/p>\n    <p><strong>Explanation:<\/strong> &#8220;06&#8221; cannot be mapped to &#8220;F&#8221; because of the leading zero (&#8220;6&#8221; is different from &#8220;06&#8221;). In this case, the string is not a valid encoding, so return 0.<\/p>\n\n    <h3>Constraints<\/h3>\n    <ul>\n       <li><code>1 <= s.length <= 100<\/code><\/li>\n        <li><code>s<\/code> contains only digits and may contain leading zero(s).<\/li>\n    <\/ul>\n    \n<h2>Approach:<\/h2>\n<ul>\n    <li><strong>Recursive with Memoization (Top-down DP)<\/strong>\n    <ul>\n        <li>Define a recursive function <code>fn(remS) \u2192 returns number<\/code> of decodings for substring <code>remS<\/code>.<\/li>\n        <li><strong>Base case:<\/strong> if string becomes empty \u2192 <code>1 valid decoding.<\/code><\/li>\n        <li><strong>Memoization:<\/strong> Store results in <code>dp<\/code> to avoid recomputation.<\/li>\n    <\/ul>\n    <\/li>\n\n    <li><strong>Choices at each step (from right side):<\/strong>\n    <ul>\n        <li><strong>One digit<\/strong>: If last digit is not <code>\"0\"<\/code>, decode it \u2192 recursive call on substring without last digit.<\/li>\n        <li><strong>Two digits<\/strong>:  If last two digits form a <code>number between 10\u201326<\/code>, decode it \u2192 recursive call on substring without <code>last two digits.<\/code><\/li>\n    <\/ul>\n    <\/li>\n    <li><strong>Add both possibilities \u2192<\/strong> total ways for that substring.<\/li>\n<\/ul>\n\n    <h2>Time & Space Complexity:<\/h2>\n    <p><strong>Time Complexity:<\/strong> <code>O(n)<\/code><\/p>\n    <p><strong>Space Complexity:<\/strong> <code>O(n)<\/code><\/p>\n\n<h2>Dry Run<\/h2>\n<div style=\"background: var(--light-bg); border-left: 4px solid var(--primary); padding: 1rem; border-radius: var(--tab-radius); margin: 1rem 0; color: var(--text-dark);\"> \n  <p><strong>Input:<\/strong> <code>s = \"226\"<\/code><\/p> \n  \n  <pre style=\"white-space: pre-wrap; background: var(--code-bg); padding: 1rem; border-radius: 8px; overflow-x: auto; color: var(--code-text);\">\n\nStep 0: Start Function numDecodings(\"226\")\ndp = {}\n\nCall fn(\"226\"):\n\nfn(\"226\"):\n- remS = \"226\" (not empty, not in dp)\n- n = 3\n- oneDigit = remS.substring(2) = \"6\"\n- twoDigit = remS.substring(1) = \"26\"\n- ans = 0\n\n  Check oneDigit != 0:\n  - \"6\" != 0 \u2192 true (coerces to number 6 != 0)\n  - ans += fn(remS.substring(0, 2)) \u2192 ans += fn(\"22\")\n\n  Check twoDigit >= 10 && twoDigit <= 26:\n  - \"26\" coerces to 26 \u2192 26 >= 10 && 26 <= 26 \u2192 true\n  - ans += fn(remS.substring(0, 1)) \u2192 ans += fn(\"2\")\n\nEvaluate fn(\"22\") (from oneDigit path of \"226\"):\nfn(\"22\"):\n- remS = \"22\"\n- n = 2\n- oneDigit = remS.substring(1) = \"2\"\n- twoDigit = remS.substring(0) = \"22\"\n- ans = 0\n\n  oneDigit != 0:\n  - \"2\" != 0 \u2192 true\n  - ans += fn(remS.substring(0,1)) \u2192 ans += fn(\"2\")\n\n  twoDigit >=10 && twoDigit <=26:\n  - \"22\" \u2192 22 between 10 and 26 \u2192 true\n  - ans += fn(remS.substring(0,0)) \u2192 ans += fn(\"\")\n\nEvaluate fn(\"2\") (first time, called from fn(\"22\")):\nfn(\"2\"):\n- remS = \"2\"\n- n = 1\n- oneDigit = remS.substring(0) = \"2\"\n- twoDigit = remS.substring(-1) \u2192 treated as substring(0) = \"2\"\n- ans = 0\n\n  oneDigit != 0:\n  - \"2\" != 0 \u2192 true\n  - ans += fn(remS.substring(0, 0)) \u2192 ans += fn(\"\")\n\n  twoDigit >=10 && twoDigit <=26:\n  - \"2\" \u2192 2 >= 10 ? false \u2192 skip\n\nEvaluate fn(\"\"):\n- remS = \"\" \u2192 base case \u2192 return 1\n\nSo fn(\"2\") = 1\n(dp still {} at this point)\n\nBack to fn(\"22\"):\n- from oneDigit path got 1\n- from twoDigit path fn(\"\") = 1\n- ans = 1 + 1 = 2\n- dp[\"22\"] = 2\nReturn 2\n\nEvaluate fn(\"2\") (second call, from twoDigit path of \"226\"):\n- fn(\"2\") is now needed again; check dp \u2192 not stored under \"2\" (we computed fn(\"2\") earlier but only stored fn(\"22\"))\n- Recompute fn(\"2\") (as above) \u2192 returns 1\n(Optionally an implementation could memoize \"2\" later, but current code only stores remS values that were computed; \"2\" wasn't stored previously.)\n\nBack to fn(\"226\"):\n- oneDigit path returned fn(\"22\") = 2\n- twoDigit path returned fn(\"2\") = 1\n- ans = 2 + 1 = 3\n- dp[\"226\"] = 3\nReturn 3\n\nStep 3: End\nReturn value = 3\n  <\/pre> \n  \n  <p><strong>Output:<\/strong> <code>3<\/code><\/p> \n<\/div>\n\n\n\n        <!-- <h2>Visualisation:<\/h2>\n        <img decoding=\"async\" src=\"https:\/\/namastedev.com\/blog\/wp-content\/uploads\/2025\/09\/Screenshot-2025-09-26-at-2.18.00\u202fPM.png\" alt=\"Stocks\" \/>\n    -->\n<\/div>\n\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    <div class=\"wp_blog_code-tab-content active\" data-lang=\"js\">\n      <pre><code class=\"language-javascript\">\nfunction numDecodings(s) {\n  const dp = {};\n\n  const fn = (remS) => {\n    if (remS === \"\") return 1;\n\n    if (remS in dp) return dp[remS];\n\n    const n = remS.length;\n    let ans = 0;\n\n    \/\/ One digit\n    const oneDigit = remS.substring(n - 1);\n    if (oneDigit !== \"0\") {\n      ans += fn(remS.substring(0, n - 1));\n    }\n\n    \/\/ Two digits (ONLY if length >= 2)\n    if (n >= 2) {\n      const twoDigit = remS.substring(n - 2);\n      const val = Number(twoDigit);\n\n      if (val >= 10 && val <= 26) {\n        ans += fn(remS.substring(0, n - 2));\n      }\n    }\n\n    dp[remS] = ans;\n    return ans;\n  };\n\n  return fn(s);\n}\n<\/code><\/pre>\n    <\/div>\n    <div class=\"wp_blog_code-tab-content\" data-lang=\"py\">\n      <pre><code class=\"language-python\">\ndef numDecodings(s):\n    dp = {}\n\n    def fn(remS):\n        if remS == \"\":\n            return 1\n        if remS in dp:\n            return dp[remS]\n\n        n = len(remS)\n        oneDigit = remS[n - 1:]\n        twoDigit = remS[n - 2:] if n >= 2 else \"\"\n\n        ans = 0\n\n        if oneDigit != \"0\":\n            ans += fn(remS[:n - 1])\n\n        if len(twoDigit) == 2 and \"10\" <= twoDigit <= \"26\":\n            ans += fn(remS[:n - 2])\n\n        dp[remS] = ans\n        return ans\n\n    return fn(s)\n      <\/code><\/pre>\n    <\/div>\n    <div class=\"wp_blog_code-tab-content\" data-lang=\"java\">\n      <pre><code class=\"language-java\">\nimport java.util.HashMap;\n\nclass Solution {\n    public int numDecodings(String s) {\n        HashMap<String, Integer> dp = new HashMap<>();\n        return fn(s, dp);\n    }\n\n    private int fn(String remS, HashMap<String, Integer> dp) {\n        if (remS.length() == 0) return 1;\n        if (dp.containsKey(remS)) return dp.get(remS);\n\n        int n = remS.length();\n        String oneDigit = remS.substring(n - 1);\n        String twoDigit = n >= 2 ? remS.substring(n - 2) : \"\";\n\n        int ans = 0;\n\n        if (!oneDigit.equals(\"0\")) {\n            ans += fn(remS.substring(0, n - 1), dp);\n        }\n\n        if (twoDigit.length() == 2 && twoDigit.compareTo(\"10\") >= 0 && twoDigit.compareTo(\"26\") <= 0) {\n            ans += fn(remS.substring(0, n - 2), dp);\n        }\n\n        dp.put(remS, ans);\n        return ans;\n    }\n}\n    <\/code><\/pre>\n    <\/div>\n\n    <div class=\"wp_blog_code-tab-content\" data-lang=\"cpp\">\n      <pre><code class=\"language-cpp\">\n#include &lt;unordered_map&gt;\n#include &lt;string&gt;\n\nusing namespace std;\n\nclass Solution {\npublic:\n    unordered_map<string, int> dp;\n\n    int fn(string remS) {\n        if (remS == \"\") return 1;\n        if (dp.count(remS)) return dp[remS];\n\n        int n = remS.length();\n        string oneDigit = remS.substr(n - 1);\n        string twoDigit = n >= 2 ? remS.substr(n - 2) : \"\";\n\n        int ans = 0;\n\n        if (oneDigit != \"0\") {\n            ans += fn(remS.substr(0, n - 1));\n        }\n\n        if (twoDigit.length() == 2 && twoDigit >= \"10\" && twoDigit <= \"26\") {\n            ans += fn(remS.substr(0, n - 2));\n        }\n\n        dp[remS] = ans;\n        return ans;\n    }\n\n    int numDecodings(string s) {\n        return fn(s);\n    }\n};\n<\/code><\/pre>\n    <\/div>\n    <div class=\"wp_blog_code-tab-content\" data-lang=\"c\">\n      <pre><code class=\"language-c\">\n#include &lt;stdio.h&gt;\n#include &lt;stdlib.h&gt;\n#include &lt;string.h&gt;\n\n#define MAX 1000\n\ntypedef struct {\n    char key[MAX];\n    int value;\n} Pair;\n\nPair dp[1000];\nint dpSize = 0;\n\nint getDp(char *key) {\n    for (int i = 0; i < dpSize; i++) {\n        if (strcmp(dp[i].key, key) == 0)\n            return dp[i].value;\n    }\n    return -1;\n}\n\nvoid setDp(char *key, int value) {\n    strcpy(dp[dpSize].key, key);\n    dp[dpSize].value = value;\n    dpSize++;\n}\n\nint fn(char *remS) {\n    if (strlen(remS) == 0) return 1;\n\n    int cached = getDp(remS);\n    if (cached != -1) return cached;\n\n    int n = strlen(remS);\n    char oneDigit[3], twoDigit[3];\n    int ans = 0;\n\n    strcpy(oneDigit, remS + n - 1);\n\n    if (strcmp(oneDigit, \"0\") != 0) {\n        char sub[MAX];\n        strncpy(sub, remS, n - 1);\n        sub[n - 1] = '\\0';\n        ans += fn(sub);\n    }\n\n    if (n >= 2) {\n        strcpy(twoDigit, remS + n - 2);\n        if (strcmp(twoDigit, \"10\") >= 0 && strcmp(twoDigit, \"26\") <= 0) {\n            char sub[MAX];\n            strncpy(sub, remS, n - 2);\n            sub[n - 2] = '\\0';\n            ans += fn(sub);\n        }\n    }\n\n    setDp(remS, ans);\n    return ans;\n}\n\nint numDecodings(char *s) {\n    return fn(s);\n}\n <\/code><\/pre>\n    <\/div>\n\n    <div class=\"wp_blog_code-tab-content\" data-lang=\"cs\">\n      <pre><code class=\"language-csharp\">\nusing System;\nusing System.Collections.Generic;\n\npublic class Solution {\n    public int NumDecodings(string s) {\n        var dp = new Dictionary<string, int>();\n        return Fn(s, dp);\n    }\n\n    private int Fn(string remS, Dictionary<string, int> dp) {\n        if (remS.Length == 0) return 1;\n        if (dp.ContainsKey(remS)) return dp[remS];\n\n        int n = remS.Length;\n        string oneDigit = remS.Substring(n - 1);\n        string twoDigit = n >= 2 ? remS.Substring(n - 2) : \"\";\n\n        int ans = 0;\n\n        if (oneDigit != \"0\") {\n            ans += Fn(remS.Substring(0, n - 1), dp);\n        }\n\n        if (twoDigit.Length == 2 && String.Compare(twoDigit, \"10\") >= 0 && String.Compare(twoDigit, \"26\") <= 0) {\n            ans += Fn(remS.Substring(0, n - 2), dp);\n        }\n\n        dp[remS] = ans;\n        return ans;\n    }\n}\n      <\/code><\/pre>\n    <\/div>\n  <\/div>\n<\/div>\n\n<script>\ndocument.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) => content.classList.remove(\"active\"));\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  const themeToggle = document.getElementById(\"blogNotesThemeToggle\");\n  const themeContainer = document.querySelector(\".wp_blog_theme\");\n\n  themeToggle.addEventListener(\"click\", () => {\n    themeContainer.classList.toggle(\"dark-mode\");\n    themeToggle.textContent =\n      themeContainer.classList.contains(\"dark-mode\") ? \"\u2600\ufe0f\" : \"\ud83c\udf19\";\n  });\n});\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>\ud83c\udf19 Problem Statement: You have intercepted a secret message encoded as a string of numbers. The message is decoded via the following mapping: &#8220;1&#8221; -> &#8216;A&#8217; &#8220;2&#8221; -> &#8216;B&#8217; &#8230; &#8220;25&#8221; -> &#8216;Y&#8217; &#8220;26&#8221; -> &#8216;Z&#8217; However, while decoding the message, you realize that there are many different ways you can decode the message because<\/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,260,176,175,211,811,810,174,172,173],"tags":[],"class_list":["post-10189","post","type-post","status-publish","format-standard","category-algorithms","category-c-c-plus-plus","category-csharp","category-cplusplus","category-data-structures","category-data-structures-and-algorithms","category-dsa","category-java","category-javascript","category-python"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/namastedev.com\/blog\/wp-json\/wp\/v2\/posts\/10189","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=10189"}],"version-history":[{"count":4,"href":"https:\/\/namastedev.com\/blog\/wp-json\/wp\/v2\/posts\/10189\/revisions"}],"predecessor-version":[{"id":12229,"href":"https:\/\/namastedev.com\/blog\/wp-json\/wp\/v2\/posts\/10189\/revisions\/12229"}],"wp:attachment":[{"href":"https:\/\/namastedev.com\/blog\/wp-json\/wp\/v2\/media?parent=10189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/namastedev.com\/blog\/wp-json\/wp\/v2\/categories?post=10189"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/namastedev.com\/blog\/wp-json\/wp\/v2\/tags?post=10189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}