{"id":52902,"date":"2025-06-30T15:40:05","date_gmt":"2025-06-30T10:10:05","guid":{"rendered":"https:\/\/www.iquanta.in\/blog\/?p=52902"},"modified":"2025-06-30T15:58:17","modified_gmt":"2025-06-30T10:28:17","slug":"kadanes-algorithm-its-complexity-working","status":"publish","type":"post","link":"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/","title":{"rendered":"Kadane&#8217;s Algorithm: It&#8217;s Complexity &amp; Working"},"content":{"rendered":"\n<p>Kadane&#8217;s Algorithm is one of the most amazing technique which is used to solve maximum sub-array problems. It involves finding the continuous sub-arrays with a one dimensional array of numbers that has the largest sum. So, whether you are preparing for coding interviews or try to analyze multiple data analysis problems or queries, then Kadane&#8217;s algorithm is really great and comes in picture. <\/p>\n\n\n\n<p>This concept is used to solve the possible subarray that take O(n^2) time complexity to cover algorithm. It scans the array only once and also used to update maximum sum along with. Because of this simplicity and high performance of algorithm makes it most widely used among developers and enthusiasts. <\/p>\n\n\n\n<p>In this blog we will be talking about Kadane&#8217;s Algorithm, working and implementation, analyze it&#8217;s time complexity, and real-life applications. Whether you are a fresher or brushing up with your DSA concepts, this guide really helpful for you to understand this concept.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/chat.whatsapp.com\/B6weknl7133BQXjPva0pgB\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"159\" src=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-172.png\" alt=\"Kadane's Algorithm\" class=\"wp-image-52846\" srcset=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-172.png 1024w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-172-300x47.png 300w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-172-768x119.png 768w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-172-150x23.png 150w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-172-696x108.png 696w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div>\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_77 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/#What_is_Kadanes_Algorithm\" >What is Kadane&#8217;s Algorithm?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/#Kadanes_Algorithm_Working_Step-By-Step\" >Kadane&#8217;s Algorithm Working (Step-By-Step)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/#Understand_the_Problem\" >Understand the Problem<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/#Kadanes_Algorithm_Code\" >Kadane&#8217;s Algorithm Code<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/#Kadanes_Brute_Force_Approach_in_C\" >Kadane&#8217;s Brute Force Approach in C++<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/#Kadanes_Brute_Force_Approach_in_Java\" >Kadane&#8217;s Brute Force Approach in Java<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/#Kadanes_Brute_Force_Approach_in_Python\" >Kadane&#8217;s Brute Force Approach in Python<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/#Time_Complexity_Analysis_of_Kadanes_Algorithm\" >Time Complexity Analysis of Kadane&#8217;s Algorithm<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/#FAQs_Frequently_Asked_Questions\" >FAQs (Frequently Asked Questions)<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/#What_is_Kadanes_Algorithm_used_for\" >What is Kadane\u2019s Algorithm used for?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/#What_is_the_time_complexity_of_Kadanes_Algorithm\" >What is the time complexity of Kadane\u2019s Algorithm?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/#Can_Kadanes_Algorithm_handle_arrays_with_all_negative_numbers\" >Can Kadane\u2019s Algorithm handle arrays with all negative numbers?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"h-what-is-kadane-s-algorithm\"><span class=\"ez-toc-section\" id=\"What_is_Kadanes_Algorithm\"><\/span><strong>What is Kadane&#8217;s Algorithm?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Kadane&#8217;s Algorithm is an important concept among developers where you are using dynamic programming techniques to find the maximum sum of subarray. The main idea behind this algorithm is to scan the particular array from left to right. <\/p>\n\n\n\n<p>This compares the array at every steps and try to find the maximum value so far. By tracking the maximum value found so far, Kadane\u2019s Algorithm efficiently solves the problem in linear time (O(n)), making it highly useful for performance-critical tasks like financial data analysis or coding competitions.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"989\" height=\"489\" src=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-175.png\" alt=\"Kadane's Algorithm\" class=\"wp-image-52947\" srcset=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-175.png 989w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-175-300x148.png 300w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-175-768x380.png 768w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-175-849x420.png 849w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-175-150x74.png 150w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-175-696x344.png 696w\" sizes=\"(max-width: 989px) 100vw, 989px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-kadane-s-algorithm-working-step-by-step\"><span class=\"ez-toc-section\" id=\"Kadanes_Algorithm_Working_Step-By-Step\"><\/span><strong>Kadane&#8217;s Algorithm Working (Step-By-Step)<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Kadane&#8217;s algorithm works by scanning the array from left to right. It uses two variables &#8211; <\/p>\n\n\n\n<ul>\n<li>max_current: Maximum sum ending at current position.<\/li>\n\n\n\n<li>max_global: The highest value max_current has ever reached.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-table is-style-regular\"><table><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>Step<\/strong><\/td><td class=\"has-text-align-center\" data-align=\"center\"><strong>Index<\/strong><\/td><td class=\"has-text-align-center\" data-align=\"center\"><strong>arr[i]<\/strong><\/td><td class=\"has-text-align-center\" data-align=\"center\"><strong>max_current = max(arr[i], max_current + arr[i])<\/strong><\/td><td class=\"has-text-align-center\" data-align=\"center\"><strong>max_global = max(max_global, max_current)<\/strong><\/td><td class=\"has-text-align-center\" data-align=\"center\"><strong>Start Index<\/strong><\/td><td><strong>End Index<\/strong><\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">1<\/td><td class=\"has-text-align-center\" data-align=\"center\">0<\/td><td class=\"has-text-align-center\" data-align=\"center\">-2<\/td><td class=\"has-text-align-center\" data-align=\"center\">-2<\/td><td class=\"has-text-align-center\" data-align=\"center\">-2<\/td><td class=\"has-text-align-center\" data-align=\"center\">0<\/td><td>0<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">2<\/td><td class=\"has-text-align-center\" data-align=\"center\">1<\/td><td class=\"has-text-align-center\" data-align=\"center\">1<\/td><td class=\"has-text-align-center\" data-align=\"center\">max(1, -2 + 1) = 1<\/td><td class=\"has-text-align-center\" data-align=\"center\">max(-2, 1) = 1<\/td><td class=\"has-text-align-center\" data-align=\"center\">1<\/td><td>1<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">3<\/td><td class=\"has-text-align-center\" data-align=\"center\">2<\/td><td class=\"has-text-align-center\" data-align=\"center\">-3<\/td><td class=\"has-text-align-center\" data-align=\"center\">max(-3, 1 &#8211; 3) = -2<\/td><td class=\"has-text-align-center\" data-align=\"center\">max(1, -2) = 1<\/td><td class=\"has-text-align-center\" data-align=\"center\"><\/td><td><\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">4<\/td><td class=\"has-text-align-center\" data-align=\"center\">3<\/td><td class=\"has-text-align-center\" data-align=\"center\">4<\/td><td class=\"has-text-align-center\" data-align=\"center\">max(4, -2 + 4) = 4<\/td><td class=\"has-text-align-center\" data-align=\"center\">max(1, 4) = 4<\/td><td class=\"has-text-align-center\" data-align=\"center\">3<\/td><td>3<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">5<\/td><td class=\"has-text-align-center\" data-align=\"center\">4<\/td><td class=\"has-text-align-center\" data-align=\"center\">-1<\/td><td class=\"has-text-align-center\" data-align=\"center\">max(-1, 4 &#8211; 1) = 3<\/td><td class=\"has-text-align-center\" data-align=\"center\">max(4, 3) = 4<\/td><td class=\"has-text-align-center\" data-align=\"center\"><\/td><td>4<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">6<\/td><td class=\"has-text-align-center\" data-align=\"center\">5<\/td><td class=\"has-text-align-center\" data-align=\"center\">2<\/td><td class=\"has-text-align-center\" data-align=\"center\">max(2, 3 + 2) = 5<\/td><td class=\"has-text-align-center\" data-align=\"center\">max(4, 5) = 5<\/td><td class=\"has-text-align-center\" data-align=\"center\"><\/td><td>5<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">7<\/td><td class=\"has-text-align-center\" data-align=\"center\">6<\/td><td class=\"has-text-align-center\" data-align=\"center\">1<\/td><td class=\"has-text-align-center\" data-align=\"center\">max(1, 5 + 1) = 6<\/td><td class=\"has-text-align-center\" data-align=\"center\">max(5, 6) = 6<\/td><td class=\"has-text-align-center\" data-align=\"center\"><\/td><td>6<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">8<\/td><td class=\"has-text-align-center\" data-align=\"center\">7<\/td><td class=\"has-text-align-center\" data-align=\"center\">-5<\/td><td class=\"has-text-align-center\" data-align=\"center\">max(-5, 6 &#8211; 5) = 1<\/td><td class=\"has-text-align-center\" data-align=\"center\">max(6, 1) = 6<\/td><td class=\"has-text-align-center\" data-align=\"center\"><\/td><td><\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">9<\/td><td class=\"has-text-align-center\" data-align=\"center\">8<\/td><td class=\"has-text-align-center\" data-align=\"center\">4<\/td><td class=\"has-text-align-center\" data-align=\"center\">max(4, 1 + 4) = 5<\/td><td class=\"has-text-align-center\" data-align=\"center\">max(6, 5) = 6<\/td><td class=\"has-text-align-center\" data-align=\"center\"><\/td><td><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-understand-the-problem\"><span class=\"ez-toc-section\" id=\"Understand_the_Problem\"><\/span><strong>Understand the Problem<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Kadane\u2019s Algorithm helps find the maximum sum of numbers that are next to each other in a list. It checks whether to continue adding or start fresh at each step.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def max_subarray_brute_force(arr):\r\n    max_sum = float('-inf')\r\n    start_idx = end_idx = 0\r\n    for i in range(len(arr)):\r\n        current_sum = 0\r\n        for j in range(i, len(arr)):\r\n            current_sum += arr&#091;j]\r\n            if current_sum &gt; max_sum:\r\n                max_sum = current_sum\r\n                start_idx = i\r\n                end_idx = j\r\n    print(f\"Brute Force -&gt; Max Sum: {max_sum}, Subarray: {arr&#091;start_idx:end_idx+1]}\")\r\n    return max_sum\r\n\r\ndef kadane_algorithm(arr):\r\n    max_current = max_global = arr&#091;0]\r\n    start = end = s = 0\r\n    for i in range(1, len(arr)):\r\n        if arr&#091;i] &gt; max_current + arr&#091;i]:\r\n            max_current = arr&#091;i]\r\n            s = i\r\n        else:\r\n            max_current += arr&#091;i]\r\n        if max_current &gt; max_global:\r\n            max_global = max_current\r\n            start = s\r\n            end = i\r\n    print(f\"Kadane's Algorithm -&gt; Max Sum: {max_global}, Subarray: {arr&#091;start:end+1]}\")\r\n    return max_global\r\n\r\narr = &#091;-2, 1, -3, 4, -1, 2, 1, -5, 4]\r\nprint(\"Original Array:\", arr)\r\nprint(\"-\" * 50)\r\nmax_subarray_brute_force(arr)\r\nkadane_algorithm(arr)\r<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"1024\" height=\"159\" src=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-173.png\" alt=\"\" class=\"wp-image-52944\" srcset=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-173.png 1024w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-173-300x47.png 300w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-173-768x119.png 768w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-173-150x23.png 150w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-173-696x108.png 696w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-kadane-s-algorithm-code\"><span class=\"ez-toc-section\" id=\"Kadanes_Algorithm_Code\"><\/span><strong>Kadane&#8217;s Algorithm Code<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>When I&#8217;m talking about Kadane&#8217;s algorithm then there are different approaches to solve and run the particular problem and approach. We will start here with the Brute Force Approach in C++, Java &amp; Python programming language. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-kadane-s-brute-force-approach-in-c\"><span class=\"ez-toc-section\" id=\"Kadanes_Brute_Force_Approach_in_C\"><\/span><strong>Kadane&#8217;s Brute Force Approach in C++<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream&gt;\r\n#include &lt;vector&gt;\r\n#include &lt;climits&gt;\r\nusing namespace std;\r\n\r\nint maxSubarrayBruteForce(vector&lt;int&gt;&amp; arr) {\r\n    int maxSum = INT_MIN;\r\n    int start = 0, end = 0;\r\n    for (int i = 0; i &lt; arr.size(); i++) {\r\n        int currentSum = 0;\r\n        for (int j = i; j &lt; arr.size(); j++) {\r\n            currentSum += arr&#091;j];\r\n            if (currentSum &gt; maxSum) {\r\n                maxSum = currentSum;\r\n                start = i;\r\n                end = j;\r\n            }\r\n        }\r\n    }\r\n    cout &lt;&lt; \"Max Sum: \" &lt;&lt; maxSum &lt;&lt; \", Subarray: \";\r\n    for (int k = start; k &lt;= end; k++) cout &lt;&lt; arr&#091;k] &lt;&lt; \" \";\r\n    cout &lt;&lt; endl;\r\n    return maxSum;\r\n}\r\n\r\nint main() {\r\n    vector&lt;int&gt; arr = {-2, 1, -3, 4, -1, 2, 1, -5, 4};\r\n    maxSubarrayBruteForce(arr);\r\n    return 0;\r\n}\r<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-kadane-s-brute-force-approach-in-java\"><span class=\"ez-toc-section\" id=\"Kadanes_Brute_Force_Approach_in_Java\"><\/span><strong>Kadane&#8217;s Brute Force Approach in Java <\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>public class MaxSubarrayBruteForce {\r\n    public static int maxSubarray(int&#091;] arr) {\r\n        int maxSum = Integer.MIN_VALUE;\r\n        int start = 0, end = 0;\r\n\r\n        for (int i = 0; i &lt; arr.length; i++) {\r\n            int currentSum = 0;\r\n            for (int j = i; j &lt; arr.length; j++) {\r\n                currentSum += arr&#091;j];\r\n                if (currentSum &gt; maxSum) {\r\n                    maxSum = currentSum;\r\n                    start = i;\r\n                    end = j;\r\n                }\r\n            }\r\n        }\r\n\r\n        System.out.print(\"Max Sum: \" + maxSum + \", Subarray: \");\r\n        for (int k = start; k &lt;= end; k++) {\r\n            System.out.print(arr&#091;k] + \" \");\r\n        }\r\n        System.out.println();\r\n        return maxSum;\r\n    }\r\n\r\n    public static void main(String&#091;] args) {\r\n        int&#091;] arr = {-2, 1, -3, 4, -1, 2, 1, -5, 4};\r\n        maxSubarray(arr);\r\n    }\r\n}\r<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-kadane-s-brute-force-approach-in-python\"><span class=\"ez-toc-section\" id=\"Kadanes_Brute_Force_Approach_in_Python\"><\/span><strong>Kadane&#8217;s Brute Force Approach in Python<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>def max_subarray_brute_force(arr):\r\n    max_sum = float('-inf')\r\n    start_idx = end_idx = 0\r\n    for i in range(len(arr)):\r\n        current_sum = 0\r\n        for j in range(i, len(arr)):\r\n            current_sum += arr&#091;j]\r\n            if current_sum &gt; max_sum:\r\n                max_sum = current_sum\r\n                start_idx = i\r\n                end_idx = j\r\n    print(f\"Max Sum: {max_sum}, Subarray: {arr&#091;start_idx:end_idx+1]}\")\r\n    return max_sum\r\n\r\narr = &#091;-2, 1, -3, 4, -1, 2, 1, -5, 4]\r\nmax_subarray_brute_force(arr)\r<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-time-complexity-analysis-of-kadane-s-algorithm\"><span class=\"ez-toc-section\" id=\"Time_Complexity_Analysis_of_Kadanes_Algorithm\"><\/span><strong>Time Complexity Analysis of Kadane&#8217;s Algorithm<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this section we will be talking about the time complexity of Kadane&#8217;s algorithm in<a href=\"https:\/\/www.iquanta.in\/blog\/100-data-structures-interview-questions-topic-wise\/\"> data structures<\/a> in almost every possible case.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>Feature \/ Metric<\/strong><\/td><td class=\"has-text-align-center\" data-align=\"center\"><strong>Brute Force Approach<\/strong><\/td><td class=\"has-text-align-center\" data-align=\"center\"><strong>Kadane\u2019s Algorithm<\/strong><\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">Time Complexity<\/td><td class=\"has-text-align-center\" data-align=\"center\">O(n\u00b2)<\/td><td class=\"has-text-align-center\" data-align=\"center\">O(n)<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">Space Complexity<\/td><td class=\"has-text-align-center\" data-align=\"center\">O(1)<\/td><td class=\"has-text-align-center\" data-align=\"center\">O(1)<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">Nested Loops Used?<\/td><td class=\"has-text-align-center\" data-align=\"center\">Yes (Two loops to check every subarray)<\/td><td class=\"has-text-align-center\" data-align=\"center\">No (Single pass through array)<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">Performance on Small Arrays<\/td><td class=\"has-text-align-center\" data-align=\"center\">Acceptable<\/td><td class=\"has-text-align-center\" data-align=\"center\">Excellent<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">Performance on Large Arrays<\/td><td class=\"has-text-align-center\" data-align=\"center\">Slow and inefficient<\/td><td class=\"has-text-align-center\" data-align=\"center\">Very fast and optimized<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">Best Case Time Complexity<\/td><td class=\"has-text-align-center\" data-align=\"center\">O(n\u00b2)<\/td><td class=\"has-text-align-center\" data-align=\"center\">O(n)<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">Worst Case Time Complexity<\/td><td class=\"has-text-align-center\" data-align=\"center\">O(n\u00b2)<\/td><td class=\"has-text-align-center\" data-align=\"center\">O(n)<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">Average Case Time Complexity<\/td><td class=\"has-text-align-center\" data-align=\"center\">O(n\u00b2)<\/td><td class=\"has-text-align-center\" data-align=\"center\">O(n)<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">Real-Time Use Case Friendly?<\/td><td class=\"has-text-align-center\" data-align=\"center\">No<\/td><td class=\"has-text-align-center\" data-align=\"center\">Yes<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">Interview Use<\/td><td class=\"has-text-align-center\" data-align=\"center\">Rarely used, only to explain concept<\/td><td class=\"has-text-align-center\" data-align=\"center\">Commonly asked and expected<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">Code Simplicity<\/td><td class=\"has-text-align-center\" data-align=\"center\">Simple but inefficient<\/td><td class=\"has-text-align-center\" data-align=\"center\">Simple and efficient<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">Use of Extra Space<\/td><td class=\"has-text-align-center\" data-align=\"center\">None<\/td><td class=\"has-text-align-center\" data-align=\"center\">None<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/chat.whatsapp.com\/B6weknl7133BQXjPva0pgB\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"159\" src=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-174.png\" alt=\"\" class=\"wp-image-52945\" srcset=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-174.png 1024w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-174-300x47.png 300w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-174-768x119.png 768w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-174-150x23.png 150w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-174-696x108.png 696w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-faqs-frequently-asked-questions\"><span class=\"ez-toc-section\" id=\"FAQs_Frequently_Asked_Questions\"><\/span><strong>FAQs (Frequently Asked Questions)<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-what-is-kadane-s-algorithm-used-for\"><span class=\"ez-toc-section\" id=\"What_is_Kadanes_Algorithm_used_for\"><\/span><strong>What is Kadane\u2019s Algorithm used for?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Kadane\u2019s Algorithm is used to find the maximum sum of a contiguous subarray within a one-dimensional array. It solves the Maximum Subarray Problem efficiently in linear time, making it ideal for real-time data analysis and competitive programming.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-what-is-the-time-complexity-of-kadane-s-algorithm\"><span class=\"ez-toc-section\" id=\"What_is_the_time_complexity_of_Kadanes_Algorithm\"><\/span><strong>What is the time complexity of Kadane\u2019s Algorithm?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The time complexity of Kadane\u2019s Algorithm is O(n), where n is the number of elements in the array. Unlike the brute-force approach, Kadane\u2019s Algorithm only makes a single pass through the array, making it much faster and more efficient.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-can-kadane-s-algorithm-handle-arrays-with-all-negative-numbers\"><span class=\"ez-toc-section\" id=\"Can_Kadanes_Algorithm_handle_arrays_with_all_negative_numbers\"><\/span><strong>Can Kadane\u2019s Algorithm handle arrays with all negative numbers?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Yes Kadane&#8217;s algorithm handle arrays with all negative numbers <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Kadane&#8217;s Algorithm is one of the most amazing technique which is used to solve maximum sub-array problems. It involves finding the continuous sub-arrays with a one dimensional array of numbers that has the largest sum. So, whether you are preparing for coding interviews or try to analyze multiple data analysis problems or queries, then Kadane&#8217;s [&hellip;]<\/p>\n","protected":false},"author":560,"featured_media":52956,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1075,1073],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.4 (Yoast SEO v21.9.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Kadane&#039;s Algorithm: It&#039;s Complexity &amp; Working - iQuanta<\/title>\n<meta name=\"description\" content=\"In this blog we will be talking about Kadane&#039;s Algorithm, working and implementation, analyze it&#039;s time complexity, and maximum subarray...\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Kadane&#039;s Algorithm: It&#039;s Complexity &amp; Working\" \/>\n<meta property=\"og:description\" content=\"In this blog we will be talking about Kadane&#039;s Algorithm, working and implementation, analyze it&#039;s time complexity, and maximum subarray...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/\" \/>\n<meta property=\"og:site_name\" content=\"iQuanta\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/iquanta.in\" \/>\n<meta property=\"article:published_time\" content=\"2025-06-30T10:10:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-30T10:28:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/Your-paragraph-text-60.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1600\" \/>\n\t<meta property=\"og:image:height\" content=\"900\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Nidhi Goswami\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nidhi Goswami\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/\"},\"author\":{\"name\":\"Nidhi Goswami\",\"@id\":\"https:\/\/www.iquanta.in\/blog\/#\/schema\/person\/ec8c8c25d0526dd86557b6fed064f7f3\"},\"headline\":\"Kadane&#8217;s Algorithm: It&#8217;s Complexity &amp; Working\",\"datePublished\":\"2025-06-30T10:10:05+00:00\",\"dateModified\":\"2025-06-30T10:28:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/\"},\"wordCount\":693,\"publisher\":{\"@id\":\"https:\/\/www.iquanta.in\/blog\/#organization\"},\"articleSection\":[\"DSA and Competitive Programming\",\"iSkills\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/\",\"url\":\"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/\",\"name\":\"Kadane's Algorithm: It's Complexity &amp; Working - iQuanta\",\"isPartOf\":{\"@id\":\"https:\/\/www.iquanta.in\/blog\/#website\"},\"datePublished\":\"2025-06-30T10:10:05+00:00\",\"dateModified\":\"2025-06-30T10:28:17+00:00\",\"description\":\"In this blog we will be talking about Kadane's Algorithm, working and implementation, analyze it's time complexity, and maximum subarray...\",\"breadcrumb\":{\"@id\":\"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.iquanta.in\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Kadane&#8217;s Algorithm: It&#8217;s Complexity &amp; Working\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.iquanta.in\/blog\/#website\",\"url\":\"https:\/\/www.iquanta.in\/blog\/\",\"name\":\"iQuanta | Cat Preparation Online\",\"description\":\"Building Learning Networks\",\"publisher\":{\"@id\":\"https:\/\/www.iquanta.in\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.iquanta.in\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.iquanta.in\/blog\/#organization\",\"name\":\"IQuanta\",\"url\":\"https:\/\/www.iquanta.in\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.iquanta.in\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2018\/08\/IQuanta-1.png\",\"contentUrl\":\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2018\/08\/IQuanta-1.png\",\"width\":525,\"height\":200,\"caption\":\"IQuanta\"},\"image\":{\"@id\":\"https:\/\/www.iquanta.in\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/facebook.com\/iquanta.in\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.iquanta.in\/blog\/#\/schema\/person\/ec8c8c25d0526dd86557b6fed064f7f3\",\"name\":\"Nidhi Goswami\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.iquanta.in\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/21d234d87afd924b217d26b25a3cf1ee?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/21d234d87afd924b217d26b25a3cf1ee?s=96&d=mm&r=g\",\"caption\":\"Nidhi Goswami\"},\"url\":\"https:\/\/www.iquanta.in\/blog\/author\/nidhigoswami\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Kadane's Algorithm: It's Complexity &amp; Working - iQuanta","description":"In this blog we will be talking about Kadane's Algorithm, working and implementation, analyze it's time complexity, and maximum subarray...","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/","og_locale":"en_US","og_type":"article","og_title":"Kadane's Algorithm: It's Complexity &amp; Working","og_description":"In this blog we will be talking about Kadane's Algorithm, working and implementation, analyze it's time complexity, and maximum subarray...","og_url":"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/","og_site_name":"iQuanta","article_publisher":"https:\/\/facebook.com\/iquanta.in","article_published_time":"2025-06-30T10:10:05+00:00","article_modified_time":"2025-06-30T10:28:17+00:00","og_image":[{"width":1600,"height":900,"url":"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/Your-paragraph-text-60.png","type":"image\/png"}],"author":"Nidhi Goswami","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Nidhi Goswami","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/#article","isPartOf":{"@id":"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/"},"author":{"name":"Nidhi Goswami","@id":"https:\/\/www.iquanta.in\/blog\/#\/schema\/person\/ec8c8c25d0526dd86557b6fed064f7f3"},"headline":"Kadane&#8217;s Algorithm: It&#8217;s Complexity &amp; Working","datePublished":"2025-06-30T10:10:05+00:00","dateModified":"2025-06-30T10:28:17+00:00","mainEntityOfPage":{"@id":"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/"},"wordCount":693,"publisher":{"@id":"https:\/\/www.iquanta.in\/blog\/#organization"},"articleSection":["DSA and Competitive Programming","iSkills"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/","url":"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/","name":"Kadane's Algorithm: It's Complexity &amp; Working - iQuanta","isPartOf":{"@id":"https:\/\/www.iquanta.in\/blog\/#website"},"datePublished":"2025-06-30T10:10:05+00:00","dateModified":"2025-06-30T10:28:17+00:00","description":"In this blog we will be talking about Kadane's Algorithm, working and implementation, analyze it's time complexity, and maximum subarray...","breadcrumb":{"@id":"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.iquanta.in\/blog\/kadanes-algorithm-its-complexity-working\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.iquanta.in\/blog\/"},{"@type":"ListItem","position":2,"name":"Kadane&#8217;s Algorithm: It&#8217;s Complexity &amp; Working"}]},{"@type":"WebSite","@id":"https:\/\/www.iquanta.in\/blog\/#website","url":"https:\/\/www.iquanta.in\/blog\/","name":"iQuanta | Cat Preparation Online","description":"Building Learning Networks","publisher":{"@id":"https:\/\/www.iquanta.in\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.iquanta.in\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.iquanta.in\/blog\/#organization","name":"IQuanta","url":"https:\/\/www.iquanta.in\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.iquanta.in\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2018\/08\/IQuanta-1.png","contentUrl":"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2018\/08\/IQuanta-1.png","width":525,"height":200,"caption":"IQuanta"},"image":{"@id":"https:\/\/www.iquanta.in\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/facebook.com\/iquanta.in"]},{"@type":"Person","@id":"https:\/\/www.iquanta.in\/blog\/#\/schema\/person\/ec8c8c25d0526dd86557b6fed064f7f3","name":"Nidhi Goswami","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.iquanta.in\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/21d234d87afd924b217d26b25a3cf1ee?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/21d234d87afd924b217d26b25a3cf1ee?s=96&d=mm&r=g","caption":"Nidhi Goswami"},"url":"https:\/\/www.iquanta.in\/blog\/author\/nidhigoswami\/"}]}},"_links":{"self":[{"href":"https:\/\/www.iquanta.in\/blog\/wp-json\/wp\/v2\/posts\/52902"}],"collection":[{"href":"https:\/\/www.iquanta.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.iquanta.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.iquanta.in\/blog\/wp-json\/wp\/v2\/users\/560"}],"replies":[{"embeddable":true,"href":"https:\/\/www.iquanta.in\/blog\/wp-json\/wp\/v2\/comments?post=52902"}],"version-history":[{"count":11,"href":"https:\/\/www.iquanta.in\/blog\/wp-json\/wp\/v2\/posts\/52902\/revisions"}],"predecessor-version":[{"id":52958,"href":"https:\/\/www.iquanta.in\/blog\/wp-json\/wp\/v2\/posts\/52902\/revisions\/52958"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.iquanta.in\/blog\/wp-json\/wp\/v2\/media\/52956"}],"wp:attachment":[{"href":"https:\/\/www.iquanta.in\/blog\/wp-json\/wp\/v2\/media?parent=52902"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iquanta.in\/blog\/wp-json\/wp\/v2\/categories?post=52902"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iquanta.in\/blog\/wp-json\/wp\/v2\/tags?post=52902"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}