{"id":11419,"date":"2025-12-31T10:33:01","date_gmt":"2025-12-31T05:03:01","guid":{"rendered":"https:\/\/namastedev.com\/blog\/?p=11419"},"modified":"2025-12-31T17:02:15","modified_gmt":"2025-12-31T11:32:15","slug":"cheapest-flight-with-k-stops","status":"publish","type":"post","link":"https:\/\/namastedev.com\/blog\/cheapest-flight-with-k-stops\/","title":{"rendered":"Cheapest Flight with K Stops"},"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        There are <code>n<\/code> cities connected by some number of <code>flights<\/code>. You are given an array flights where <code>flights[i] = [from<sub>i<\/sub>, to<sub>i<\/sub>, price<sub>i<\/sub>]<\/code> indicates that there is a flight from city <code>from<sub>i<\/sub><\/code> to city <code>to<sub>i<\/sub><\/code> with cost pricei.\n    <\/p>\n    <p>\n        You are also given three integers <code>src<\/code>, <code>dst<\/code>, and <code>k<\/code>, return <i><strong>the cheapest price<\/strong><\/i> from <code>src<\/code> to <code>dst<\/code> with at most <code>k<\/code> stops. If there is no such route, return <code>-1<\/code>.\n    <\/p>\n\n    <h3>Example 1:<\/h2>\n    <img decoding=\"async\" src=\"https:\/\/namastedev.com\/blog\/wp-content\/uploads\/2025\/12\/Screenshot-2025-12-31-at-10.11.14-AM.png\" alt=\"\">\n    <p><strong>Input:<\/strong> n = 4, flights = [[0,1,100],[1,2,100],[2,0,100],[1,3,600],[2,3,200]], src = 0, dst = 3, k = 1<\/p>\n    <p><strong>Output:<\/strong> 700<\/p>\n    <p><strong>Explanation:<\/strong> The graph is shown above.\nThe optimal path with at most 1 stop from city 0 to 3 is marked in red and has cost 100 + 600 = 700.\nNote that the path through cities [0,1,2,3] is cheaper but is invalid because it uses 2 stops.\n<\/p>\n\n    <h3>Example 2:<\/h2>\n    <img decoding=\"async\" src=\"https:\/\/namastedev.com\/blog\/wp-content\/uploads\/2025\/12\/Screenshot-2025-12-31-at-10.11.23-AM.png\" alt=\"\">\n    <p><strong>Input:<\/strong> n = 3, flights = [[0,1,100],[1,2,100],[0,2,500]], src = 0, dst = 2, k = 1<\/p>\n    <p><strong>Output:<\/strong> 200<\/p>\n    <p><strong>Explanation:<\/strong>The graph is shown above.\nThe optimal path with at most 1 stop from city 0 to 2 is marked in red and has cost 100 + 100 = 200.<\/p>\n\n    <h3>Example 3:<\/h2>\n    <img decoding=\"async\" src=\"https:\/\/namastedev.com\/blog\/wp-content\/uploads\/2025\/12\/Screenshot-2025-12-31-at-10.11.31-AM.png\" alt=\"\">\n    <p><strong>Input:<\/strong> n = 3, flights = [[0,1,100],[1,2,100],[0,2,500]], src = 0, dst = 2, k = 0<\/p>\n    <p><strong>Output:<\/strong> 500<\/p>\n    <p><strong>Explanation:<\/strong> The graph is shown above.\nThe optimal path with no stops from city 0 to 2 is marked in red and has cost 500.\n.<\/p>\n\n    <h3>Constraints<\/h3>\n    <ul>\n        <li><code>2 <= n <= 100<\/code><\/li>\n        <li><code>0 <= flights.length <= (n * (n - 1) \/ 2)<\/code><\/li>\n        <li><code>flights[i].length == 3<\/code><\/li>\n        <li><code>0 <= from<sub>i<\/sub>, to<sub>i<\/sub> < n<\/code><\/li>\n        <li><code>from<sub>i<\/sub> != to<sub>i<\/sub><\/code><\/li>\n        <li><code>1 <= price<sub>i<\/sub> <= 10<sup>4<\/sup><\/code><\/li>\n        <li>There will not be any multiple flights between two cities.<\/li>\n        <li><code>0 <= src, dst, k < n<\/code><\/li>\n        <li><code>src != dst<\/code><\/li>\n    <\/ul>\n    \n<h2>Approach<\/h2>\n   <ul>\n    <li>Build an <code>adjacency list<\/code> from the flights array where each city stores its <strong>neighbors and travel cost<\/strong>.<\/li>\n    <li>Use a <strong>BFS-style queue<\/strong> that keeps track of (<code>current city, total cost, number of stops<\/code>).<\/li>\n    <li>Maintain a <code>minPrice<\/code> array to store the <strong>cheapest cost<\/strong> found so far to reach each city.<\/li>\n    <li>Start from the source city with cost <code>0<\/code> and <code>0<\/code> stops.<\/li>\n    <li>While processing the queue:\n        <ul>\n            <li>Skip paths that exceed <code>k<\/code> stops.<\/li>\n            <li>For each neighbor, update the cost if a <strong>cheaper price<\/strong> is found and push it into the queue with increased stops.<\/li>\n        <\/ul>\n    <\/li>\n    <li>Finally, return the minimum cost to reach dst; if unreachable within k stops, <code>return -1<\/code>.<\/li>\n<\/ul>\n\n    <h2>Time & Space Complexity<\/h2>\n    <p><strong>Time Complexity:<\/strong> <code>O(E x K)<\/code><\/p>\n    <p><strong>Space Complexity:<\/strong> <code>O(N + E)<\/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> \n    <code>n = 4<\/code>, \n    <code>flights = [[0,1,100],[1,2,100],[0,2,500]]<\/code>, \n    <code>src = 0<\/code>, \n    <code>dst = 2<\/code>, \n    <code>k = 1<\/code>\n  <\/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: findCheapestPrice(4, flights, 0, 2, 1)\n\nStep 1: Build Graph (Adjacency List)\n\ngraph = [\n  [[1, 100], [2, 500]],   \/\/ 0\n  [[2, 100]],             \/\/ 1\n  [],                     \/\/ 2\n  []                      \/\/ 3\n]\n\nStep 2: Initialize minPrice array\n\nminPrice = [0, Infinity, Infinity, Infinity]\n\nStep 3: Initialize Queue\n\nq = [[0, 0, 0]]   \/\/ [city, cost, stops]\n\n--------------------------------------------------\n\nStep 4: Start BFS Traversal\n\nDequeue \u2192 [0, 0, 0]\nstops = 0 (\u2264 k, continue)\n\nExplore neighbors of city 0:\n\n1) Neighbor = 1, price = 100\n   newPrice = 0 + 100 = 100\n   100 < Infinity \u2192 update\n\n   minPrice = [0, 100, Infinity, Infinity]\n   q = [[1, 100, 1]]\n\n2) Neighbor = 2, price = 500\n   newPrice = 0 + 500 = 500\n   500 < Infinity \u2192 update\n\n   minPrice = [0, 100, 500, Infinity]\n   q = [[1, 100, 1], [2, 500, 1]]\n\n--------------------------------------------------\n\nDequeue \u2192 [1, 100, 1]\nstops = 1 (\u2264 k, continue)\n\nExplore neighbors of city 1:\n\n1) Neighbor = 2, price = 100\n   newPrice = 100 + 100 = 200\n   200 < 500 \u2192 update\n\n   minPrice = [0, 100, 200, Infinity]\n   q = [[2, 500, 1], [2, 200, 2]]\n\n--------------------------------------------------\n\nDequeue \u2192 [2, 500, 1]\nstops = 1 (\u2264 k, continue)\n\nCity 2 has no neighbors \u2192 nothing happens\n\n--------------------------------------------------\n\nDequeue \u2192 [2, 200, 2]\nstops = 2 (> k) \u2192 skip this path\n\n--------------------------------------------------\n\nStep 5: End BFS\n\nminPrice = [0, 100, 200, Infinity]\n\nStep 6: Return Result\n\nminPrice[dst] = minPrice[2] = 200\n  <\/pre> \n  \n  <p><strong>Output:<\/strong> <code>200<\/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\/4.png\" alt=\"\"> -->\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\">\nvar findCheapestPrice = function(n, flights, src, dst, k) {\n    let graph = Array.from({ length: n}, () => []);\n    for(let [from, to, price] of flights) {\n        graph[from].push([to, price]);\n    }\n\n    let minPrice = new Array(n).fill(Infinity);\n    minPrice[src] = 0;\n\n    \/\/ [city, cost, stops]\n    let q = [[src, 0, 0]];\n    while(q.length) {\n        let [curr, currPrice, stops] = q.shift();\n        if(stops > k) continue;\n        for(let [neighbor, neighborPrice] of graph[curr]) {\n            let newPrice = currPrice + neighborPrice;\n            if(newPrice < minPrice[neighbor]) {\n                minPrice[neighbor] = newPrice;\n                q.push([neighbor, newPrice, stops + 1])\n            } \n        }\n    }\n    return minPrice[dst] === Infinity ? -1 : minPrice[dst];\n};\n<\/code><\/pre>\n    <\/div>\n    <div class=\"wp_blog_code-tab-content\" data-lang=\"py\">\n      <pre><code class=\"language-python\">\nfrom collections import deque\nfrom typing import List\n\ndef findCheapestPrice(n: int, flights: List[List[int]], src: int, dst: int, k: int) -> int:\n    graph = [[] for _ in range(n)]\n    for u, v, price in flights:\n        graph[u].append((v, price))\n\n    minPrice = [float('inf')] * n\n    minPrice[src] = 0\n\n    q = deque([(src, 0, 0)])  # city, cost, stops\n\n    while q:\n        city, cost, stops = q.popleft()\n        if stops > k:\n            continue\n\n        for nxt, price in graph[city]:\n            newPrice = cost + price\n            if newPrice < minPrice[nxt]:\n                minPrice[nxt] = newPrice\n                q.append((nxt, newPrice, stops + 1))\n    return -1 if minPrice[dst] == float('inf') else minPrice[dst]\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.*;\n\nclass Solution {\n    public int findCheapestPrice(int n, int[][] flights, int src, int dst, int k) {\n        List<int[]>[] graph = new ArrayList[n];\n        for (int i = 0; i < n; i++) graph[i] = new ArrayList<>();\n\n        for (int[] f : flights) {\n            graph[f[0]].add(new int[]{f[1], f[2]});\n        }\n\n        int[] minPrice = new int[n];\n        Arrays.fill(minPrice, Integer.MAX_VALUE);\n        minPrice[src] = 0;\n\n        Queue<int[]> q = new LinkedList<>();\n        q.offer(new int[]{src, 0, 0}); \/\/ city, cost, stops\n\n        while (!q.isEmpty()) {\n            int[] curr = q.poll();\n            int city = curr[0], cost = curr[1], stops = curr[2];\n\n            if (stops > k) continue;\n\n            for (int[] nbr : graph[city]) {\n                int nextCity = nbr[0];\n                int price = nbr[1];\n                int newPrice = cost + price;\n\n                if (newPrice < minPrice[nextCity]) {\n                    minPrice[nextCity] = newPrice;\n                    q.offer(new int[]{nextCity, newPrice, stops + 1});\n                }\n            }\n        }\n\n        return minPrice[dst] == Integer.MAX_VALUE ? -1 : minPrice[dst];\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;vector&gt;\n#include &lt;queue&gt;\n#include &lt;climits&gt;\nusing namespace std;\n\nint findCheapestPrice(int n, vector<vector<int>>& flights, int src, int dst, int k) {\n    vector<vector<pair<int, int>>> graph(n);\n    for (auto &f : flights) {\n        graph[f[0]].push_back({f[1], f[2]});\n    }\n\n    vector<int> minPrice(n, INT_MAX);\n    minPrice[src] = 0;\n\n    queue<vector<int>> q;\n    q.push({src, 0, 0}); \/\/ city, cost, stops\n\n    while (!q.empty()) {\n        auto curr = q.front();\n        q.pop();\n\n        int city = curr[0], cost = curr[1], stops = curr[2];\n        if (stops > k) continue;\n\n        for (auto &nbr : graph[city]) {\n            int nextCity = nbr.first;\n            int price = nbr.second;\n\n            int newPrice = cost + price;\n            if (newPrice < minPrice[nextCity]) {\n                minPrice[nextCity] = newPrice;\n                q.push({nextCity, newPrice, stops + 1});\n            }\n        }\n    }\n    return minPrice[dst] == INT_MAX ? -1 : minPrice[dst];\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;limits.h&gt;\n\ntypedef struct {\n    int to;\n    int price;\n} Edge;\n\ntypedef struct {\n    Edge edges[1000];\n    int size;\n} GraphNode;\n\nint findCheapestPrice(int n, int flights[][3], int flightsSize, int src, int dst, int k) {\n    GraphNode graph[100];\n    for (int i = 0; i < n; i++) graph[i].size = 0;\n\n    for (int i = 0; i < flightsSize; i++) {\n        int from = flights[i][0];\n        graph[from].edges[graph[from].size++] =\n            (Edge){flights[i][1], flights[i][2]};\n    }\n\n    int minPrice[100];\n    for (int i = 0; i < n; i++) minPrice[i] = INT_MAX;\n    minPrice[src] = 0;\n\n    int q[1000][3], front = 0, rear = 0;\n    q[rear][0] = src;\n    q[rear][1] = 0;\n    q[rear][2] = 0;\n    rear++;\n\n    while (front < rear) {\n        int city = q[front][0];\n        int cost = q[front][1];\n        int stops = q[front][2];\n        front++;\n\n        if (stops > k) continue;\n\n        for (int i = 0; i < graph[city].size; i++) {\n            int nextCity = graph[city].edges[i].to;\n            int price = graph[city].edges[i].price;\n            int newPrice = cost + price;\n\n            if (newPrice < minPrice[nextCity]) {\n                minPrice[nextCity] = newPrice;\n                q[rear][0] = nextCity;\n                q[rear][1] = newPrice;\n                q[rear][2] = stops + 1;\n                rear++;\n            }\n        }\n    }\n\n    return minPrice[dst] == INT_MAX ? -1 : minPrice[dst];\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 FindCheapestPrice(int n, int[][] flights, int src, int dst, int k) {\n        var graph = new List<(int, int)>[n];\n        for (int i = 0; i < n; i++) graph[i] = new List<(int, int)>();\n\n        foreach (var f in flights) {\n            graph[f[0]].Add((f[1], f[2]));\n        }\n\n        int[] minPrice = new int[n];\n        Array.Fill(minPrice, int.MaxValue);\n        minPrice[src] = 0;\n\n        var q = new Queue<(int city, int cost, int stops)>();\n        q.Enqueue((src, 0, 0));\n\n        while (q.Count > 0) {\n            var (city, cost, stops) = q.Dequeue();\n            if (stops > k) continue;\n\n            foreach (var (next, price) in graph[city]) {\n                int newPrice = cost + price;\n                if (newPrice < minPrice[next]) {\n                    minPrice[next] = newPrice;\n                    q.Enqueue((next, newPrice, stops + 1));\n                }\n            }\n        }\n        return minPrice[dst] == int.MaxValue ? -1 : minPrice[dst];\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\n","protected":false},"excerpt":{"rendered":"<p>\ud83c\udf19 Problem Statement There are n cities connected by some number of flights. You are given an array flights where flights[i] = [fromi, toi, pricei] indicates that there is a flight from city fromi to city toi with cost pricei. You are also given three integers src, dst, and k, return the cheapest price from<\/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,260,176,175,211,811,810,174,172,173],"tags":[],"class_list":{"0":"post-11419","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-algorithms","7":"category-algorithms-and-data-structures","8":"category-c-c-plus-plus","9":"category-csharp","10":"category-cplusplus","11":"category-data-structures","12":"category-data-structures-and-algorithms","13":"category-dsa","14":"category-java","15":"category-javascript","16":"category-python"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/namastedev.com\/blog\/wp-json\/wp\/v2\/posts\/11419","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=11419"}],"version-history":[{"count":1,"href":"https:\/\/namastedev.com\/blog\/wp-json\/wp\/v2\/posts\/11419\/revisions"}],"predecessor-version":[{"id":11420,"href":"https:\/\/namastedev.com\/blog\/wp-json\/wp\/v2\/posts\/11419\/revisions\/11420"}],"wp:attachment":[{"href":"https:\/\/namastedev.com\/blog\/wp-json\/wp\/v2\/media?parent=11419"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/namastedev.com\/blog\/wp-json\/wp\/v2\/categories?post=11419"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/namastedev.com\/blog\/wp-json\/wp\/v2\/tags?post=11419"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}