{"id":892,"date":"2025-08-13T19:32:54","date_gmt":"2025-08-13T14:02:54","guid":{"rendered":"https:\/\/codeanddebug.in\/blog\/?p=892"},"modified":"2025-08-13T19:32:55","modified_gmt":"2025-08-13T14:02:55","slug":"partitions-with-given-difference","status":"publish","type":"post","link":"https:\/\/codeanddebug.in\/blog\/partitions-with-given-difference\/","title":{"rendered":"Partitions with Given Difference | Optimal Solution"},"content":{"rendered":"\n<p>Given an array&nbsp;<strong>arr[]<\/strong>, partition it into two subsets(possibly empty) such that each element must belong to only one subset. Let the sum of the elements of these two subsets be&nbsp;<strong>sum1<\/strong>&nbsp;and&nbsp;<strong>sum<\/strong><strong>2<\/strong>. Given a difference&nbsp;<strong>d<\/strong>, count the number of partitions in which&nbsp;<strong>sum<\/strong><strong>1<\/strong>&nbsp;is greater than or equal to&nbsp;<strong>sum<\/strong><strong>2<\/strong>&nbsp;and the difference between&nbsp;<strong>sum<\/strong><strong>1<\/strong>&nbsp;and&nbsp;<strong>sum<\/strong><strong>2<\/strong>&nbsp;is equal to&nbsp;<strong>d<\/strong>.&nbsp;<\/p>\n\n\n\n<p>Here&#8217;s the [<strong><a href=\"https:\/\/www.geeksforgeeks.org\/problems\/partitions-with-given-difference\/1\" target=\"_blank\" rel=\"noreferrer noopener\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\"><span style=\"text-decoration: underline;\">Problem Link<\/span><\/mark><\/a><\/strong>] to begin with.<\/p>\n\n\n\n<p><strong>Examples :<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>Input: <\/strong>arr[] =  [5, 2, 6, 4], d = 3\n<strong>Output: <\/strong>1\n<strong>Explanation: <\/strong>There is only one possible partition of this array. Partition : {6, 4}, {5, 2}. The subset difference between subset sum is: (6 + 4) - (5 + 2) = 3.<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>Input:<\/strong> arr[] = [1, 1, 1, 1], d = 0 <br><strong>Output:<\/strong> 6 <br><strong>Explanation: <\/strong>We can choose two 1's from indices {0,1}, {0,2}, {0,3}, {1,2}, {1,3}, {2,3} and put them in sum1 and remaning two 1's in sum2.<br>Thus there are total 6 ways for partition the array arr. <\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>Input:<\/strong> arr[] = [1, 2, 1, 0, 1, 3, 3], d = 11<br><strong>Output:<\/strong> 2<\/pre>\n\n\n\n<p><strong>Constraint:<\/strong><br>1 &lt;= arr.size() &lt;= 50<br>0 &lt;= d&nbsp; &lt;= 50<br>0 &lt;= arr[i] &lt;= 6<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Problem-to-Subset-Sum Reduction<\/h2>\n\n\n\n<p>Given an array arr, split it into two subsets S1 and S2 such that:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>sum(S1)<\/strong> \u2212 <strong>sum(S2)<\/strong> = <strong>d<\/strong><\/li>\n\n\n\n<li>Let<strong> total = sum(arr)<\/strong>, and let <strong>s1 = sum(S1).<\/strong><\/li>\n\n\n\n<li>Since<strong> s1 + s2 = total <\/strong>and <strong>s1 \u2212 s2 = d<\/strong>, solving these gives <strong>s1 = (total \u2212 d)\/2.<\/strong><\/li>\n<\/ul>\n\n\n\n<p>Therefore, counting the number of valid partitions with difference <strong>d <\/strong>is equivalent to counting the number of subsets with sum exactly <strong>(total \u2212 d)\/2<\/strong>, provided that:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>(total \u2212 d) \u2265 0<\/strong><\/li>\n\n\n\n<li><strong>(total \u2212 d) is even<\/strong><\/li>\n<\/ul>\n\n\n\n<p>If either fails, the answer is<strong> 0.<\/strong><\/p>\n\n\n\n<p>This is exactly where the Perfect Sum DP (count of subsets equal to a target) plugs in.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-modify-the-previous-perfect-sum-solution\">How to Modify the Previous \u201cPerfect Sum\u201d Solution<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Compute total =<strong> sum(arr).<\/strong><\/li>\n\n\n\n<li>Validate feasibility:\n<ul class=\"wp-block-list\">\n<li>If <strong>(total \u2212 d) &lt; 0 or (total \u2212 d) is odd, return 0.<\/strong><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Set <strong>target = (total \u2212 d) \/\/ 2.<\/strong><\/li>\n\n\n\n<li>Return count of subsets equal to target using the same Perfect Sum DP (with careful zero handling).<\/li>\n<\/ol>\n\n\n\n<p>This reuses the exact counting DP from Perfect Sum, including the special initialization when zeros appear (since zeros double the number of ways to achieve sum 0 at that position).<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"space-optimized-counting-dp-reused-as-is\">Space-Optimized Counting DP (Reused as-is)<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>prev[t] stores the count of subsets from the processed prefix that sum to t.<\/li>\n\n\n\n<li>Handle arr carefully:\n<ul class=\"wp-block-list\">\n<li>If arr == 0: prev = 2 (pick or not-pick both keep sum 0).<\/li>\n\n\n\n<li>Else prev = 1, and if arr \u2264 target then prev[arr] = 1.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Transition for each element:\n<ul class=\"wp-block-list\">\n<li>pick = prev[t \u2212 arr[i]] if arr[i] \u2264 t else 0<\/li>\n\n\n\n<li>not_pick = prev[t]<\/li>\n\n\n\n<li>curr[t] = pick + not_pick<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>This is exactly the logic from the Perfect Sum Problem.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"complete-code-minimal-comments-only-no-changes-to\">Complete Code<\/h2>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"class Solution:\n    def perfectSum(self, arr, target):\n        n = len(arr)\n        prev = [0 for _ in range(0, target + 1)]\n        # Base init for index 0 with zero handling\n        if arr == 0:\n            prev = 2\n        else:\n            prev = 1\n            if arr &lt;= target:\n                prev[arr] = 1\n        # Rolling 1D DP for counts\n        for index in range(1, n):\n            curr = [0 for _ in range(0, target + 1)]\n            for total in range(0, target + 1):\n                if arr[index] &gt; total:\n                    pick = 0\n                else:\n                    pick = prev[total - arr[index]]\n                not_pick = prev[total]\n                curr[total] = pick + not_pick\n            prev = curr\n        return prev[target]\n\n    def countPartitions(self, arr, d):\n        n = len(arr)\n        total = sum(arr)\n        # Feasibility check for target = (total - d) \/ 2\n        if (total - d) &lt; 0 or (total - d) % 2 == 1:\n            return 0\n        return self.perfectSum(arr, (total - d) \/\/ 2)\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #569CD6\">class<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #4EC9B0\">Solution<\/span><span style=\"color: #D4D4D4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #569CD6\">def<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #DCDCAA\">perfectSum<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">self<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #9CDCFE\">arr<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #9CDCFE\">target<\/span><span style=\"color: #D4D4D4\">):<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        n = <\/span><span style=\"color: #DCDCAA\">len<\/span><span style=\"color: #D4D4D4\">(arr)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        prev = [<\/span><span style=\"color: #B5CEA8\">0<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #C586C0\">for<\/span><span style=\"color: #D4D4D4\"> _ <\/span><span style=\"color: #C586C0\">in<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #DCDCAA\">range<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #B5CEA8\">0<\/span><span style=\"color: #D4D4D4\">, target + <\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\">)]<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        <\/span><span style=\"color: #6A9955\"># Base init for index 0 with zero handling<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        <\/span><span style=\"color: #C586C0\">if<\/span><span style=\"color: #D4D4D4\"> arr == <\/span><span style=\"color: #B5CEA8\">0<\/span><span style=\"color: #D4D4D4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">            prev = <\/span><span style=\"color: #B5CEA8\">2<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        <\/span><span style=\"color: #C586C0\">else<\/span><span style=\"color: #D4D4D4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">            prev = <\/span><span style=\"color: #B5CEA8\">1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">            <\/span><span style=\"color: #C586C0\">if<\/span><span style=\"color: #D4D4D4\"> arr &lt;= target:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">                prev[arr] = <\/span><span style=\"color: #B5CEA8\">1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        <\/span><span style=\"color: #6A9955\"># Rolling 1D DP for counts<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        <\/span><span style=\"color: #C586C0\">for<\/span><span style=\"color: #D4D4D4\"> index <\/span><span style=\"color: #C586C0\">in<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #DCDCAA\">range<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\">, n):<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">            curr = [<\/span><span style=\"color: #B5CEA8\">0<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #C586C0\">for<\/span><span style=\"color: #D4D4D4\"> _ <\/span><span style=\"color: #C586C0\">in<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #DCDCAA\">range<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #B5CEA8\">0<\/span><span style=\"color: #D4D4D4\">, target + <\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\">)]<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">            <\/span><span style=\"color: #C586C0\">for<\/span><span style=\"color: #D4D4D4\"> total <\/span><span style=\"color: #C586C0\">in<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #DCDCAA\">range<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #B5CEA8\">0<\/span><span style=\"color: #D4D4D4\">, target + <\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\">):<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">                <\/span><span style=\"color: #C586C0\">if<\/span><span style=\"color: #D4D4D4\"> arr[index] &gt; total:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">                    pick = <\/span><span style=\"color: #B5CEA8\">0<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">                <\/span><span style=\"color: #C586C0\">else<\/span><span style=\"color: #D4D4D4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">                    pick = prev[total - arr[index]]<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">                not_pick = prev[total]<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">                curr[total] = pick + not_pick<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">            prev = curr<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        <\/span><span style=\"color: #C586C0\">return<\/span><span style=\"color: #D4D4D4\"> prev[target]<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #569CD6\">def<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #DCDCAA\">countPartitions<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">self<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #9CDCFE\">arr<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #9CDCFE\">d<\/span><span style=\"color: #D4D4D4\">):<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        n = <\/span><span style=\"color: #DCDCAA\">len<\/span><span style=\"color: #D4D4D4\">(arr)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        total = <\/span><span style=\"color: #DCDCAA\">sum<\/span><span style=\"color: #D4D4D4\">(arr)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        <\/span><span style=\"color: #6A9955\"># Feasibility check for target = (total - d) \/ 2<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        <\/span><span style=\"color: #C586C0\">if<\/span><span style=\"color: #D4D4D4\"> (total - d) &lt; <\/span><span style=\"color: #B5CEA8\">0<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">or<\/span><span style=\"color: #D4D4D4\"> (total - d) % <\/span><span style=\"color: #B5CEA8\">2<\/span><span style=\"color: #D4D4D4\"> == <\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">            <\/span><span style=\"color: #C586C0\">return<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #B5CEA8\">0<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        <\/span><span style=\"color: #C586C0\">return<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">self<\/span><span style=\"color: #D4D4D4\">.perfectSum(arr, (total - d) \/\/ <\/span><span style=\"color: #B5CEA8\">2<\/span><span style=\"color: #D4D4D4\">)<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"notes-and-edge-cases\">Notes and Edge Cases<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Zeros in arr: Already handled by the Perfect Sum initialization (prev = 2 when arr == 0), which is crucial for accurate counting.<\/li>\n\n\n\n<li>Large counts: If the platform requires modulo (e.g., 1e9+7), wrap additions in modulo at each DP update; your current function returns raw counts.<\/li>\n\n\n\n<li>Non-negative integers: The reduction assumes non-negative inputs, consistent with Perfect Sum assumptions.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"takeaway\">Takeaway<\/h2>\n\n\n\n<p>\u201cPartitions with Given Difference\u201d is just the Perfect Sum Problem in disguise: compute target = (total \u2212 d)\/2 and count subsets with that sum using the same DP. This small transformation unlocks a clean, efficient, and reusable solution.<\/p>\n\n\n\n<div class=\"wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-16018d1d wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/codeanddebug.in\/course\/zero-to-hero-python-dsa\" target=\"_blank\" rel=\"noreferrer noopener\">Join our Advance DSA COURSE<\/a><\/div>\n<\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><em>For any changes to the article, kindly email at <a href=\"mailto:code@codeanddebug.in\" target=\"_blank\" rel=\"noreferrer noopener\">code@codeanddebug.in<\/a> or contact us at <a href=\"tel:+91-9712928220\" target=\"_blank\" rel=\"noreferrer noopener\">+91-9712928220<\/a>.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Given an array&nbsp;arr[], partition it into two subsets(possibly empty) such that each element must belong to only one subset. Let the sum of the elements of these two subsets be&nbsp;sum1&nbsp;and&nbsp;sum2. Given a difference&nbsp;d, count the number of partitions in which&nbsp;sum1&nbsp;is greater than or equal to&nbsp;sum2&nbsp;and the difference between&nbsp;sum1&nbsp;and&nbsp;sum2&nbsp;is equal to&nbsp;d.&nbsp; Here&#8217;s the [Problem Link] to<\/p>\n","protected":false},"author":1,"featured_media":893,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,6],"tags":[39,19],"class_list":{"0":"post-892","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-data-structures-and-algorithm","8":"category-intermediate","9":"tag-dynamic-programming-on-subsequence","10":"tag-medium"},"featured_image_src":"https:\/\/codeanddebug.in\/blog\/wp-content\/uploads\/2025\/08\/partitions-with-given-difference-featured-image.png","author_info":{"display_name":"codeanddebug","author_link":"https:\/\/codeanddebug.in\/blog\/author\/codeanddebug\/"},"_links":{"self":[{"href":"https:\/\/codeanddebug.in\/blog\/wp-json\/wp\/v2\/posts\/892","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codeanddebug.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codeanddebug.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codeanddebug.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codeanddebug.in\/blog\/wp-json\/wp\/v2\/comments?post=892"}],"version-history":[{"count":1,"href":"https:\/\/codeanddebug.in\/blog\/wp-json\/wp\/v2\/posts\/892\/revisions"}],"predecessor-version":[{"id":894,"href":"https:\/\/codeanddebug.in\/blog\/wp-json\/wp\/v2\/posts\/892\/revisions\/894"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codeanddebug.in\/blog\/wp-json\/wp\/v2\/media\/893"}],"wp:attachment":[{"href":"https:\/\/codeanddebug.in\/blog\/wp-json\/wp\/v2\/media?parent=892"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codeanddebug.in\/blog\/wp-json\/wp\/v2\/categories?post=892"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codeanddebug.in\/blog\/wp-json\/wp\/v2\/tags?post=892"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}