{"id":4249,"date":"2021-08-24T17:18:22","date_gmt":"2021-08-24T17:18:22","guid":{"rendered":"https:\/\/www.prepbytes.com\/blog\/?p=4249"},"modified":"2022-03-09T08:05:03","modified_gmt":"2022-03-09T08:05:03","slug":"run-length-decoding-in-linked-list","status":"publish","type":"post","link":"https:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/","title":{"rendered":"Run Length Decoding in Linked List"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1644926152813-110.Run%20Length%20Decoding%20in%20Linked%20List-05.png\" alt=\"\" \/><\/p>\n<h3>Introduction<\/h3>\n<p>The linked list is one of the most important concepts and data structures to learn while preparing for interviews. Having a good grasp of Linked Lists can be a huge plus point in a coding interview.<\/p>\n<\/p>\n<h3>Problem Statement<\/h3>\n<p>We will be provided with a Linked List in encoded form (like <strong>a4de4f2<\/strong>) and we need to decode the given linked list and output the decoded version in the form of string.<\/p>\n<h5>Example<\/h5>\n<p><strong>Input Linked List :<\/strong> <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/prepbytes.com\/blog\/wp-content\/uploads\/2021\/08\/input-12.png\" alt=\"\" \/><\/p>\n<p><strong>Output String :<\/strong> aaaadeeeeff<\/p>\n<h3>Problem Statement Understanding<\/h3>\n<p>Giving you a brief description about run length encoding.  <\/p>\n<p>In Run Length Encoding, the input string is encoded by replacing a substring of a repeated character in the string by the character followed by its count. If the character is single and non-repeating, then it&#8217;s count is not added.<\/p>\n<p><strong>For example<\/strong><\/p>\n<ul>\n<li>If the input string is <strong>aaaa<\/strong> then its run length encoding will be <strong>a4<\/strong><\/li>\n<li>If we add <strong>dd<\/strong> to the above string <strong>aaaa<\/strong> then the resultant string will be <strong>aaaadd<\/strong> and now its run length encoding will become <strong>a4d2<\/strong>.<\/li>\n<li>Similarly, if we add <strong>eee<\/strong> to the string <strong>aaaadd<\/strong> then the resultant string will be <strong>aaaaddeee<\/strong> and now its run length encoding will become <strong>a4d2e3<\/strong>.<\/li>\n<li>But there is case like if we add a single character to the like <strong>f<\/strong> to the string <strong>aaaaddeee<\/strong>, then the resultant string will be <strong>aaaaddeeef<\/strong> and its run length encoding will be <strong>a4d2e3f<\/strong>.<\/li>\n<\/ul>\n<p>I think from the above pattern you got it how we are encoding the input string.<\/p>\n<h4>Example of Run Length Encoding<\/h4>\n<p><strong>Input String<\/strong> &#8211; aaaadeeeeff<br \/>\n<strong>Output String (Encoded Using Run Length Algorithm)<\/strong> &#8211; a4de4f2<\/p>\n<p>Now, since you have understood what Run length encoding is, let us move to our problem statement description.<\/p>\n<p>We will be provided with a Linked List in encoded form (like <strong>a4de4f2<\/strong>) and we need to decode the given linked list and output the decoded version in the form of a string.<\/p>\n<h4>Considering same example for run length decoding<\/h4>\n<p><strong>Input Linked List :<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/prepbytes.com\/blog\/wp-content\/uploads\/2021\/08\/input-12.png\" alt=\"\" \/><\/p>\n<p><strong>Output String :<\/strong> aaaadeeeeff<\/p>\n<p><strong>Explanation :<\/strong> Given a linked list a \u2192 4 \u2192 d \u2192 e \u2192 4 \u2192 f \u2192 2, which means that:<\/p>\n<ul>\n<li><strong>a<\/strong> occur 4 times. <\/li>\n<li><strong>d<\/strong> occur only once because following <strong>d<\/strong> there is no count i.e. the next node does not contain any digit representing the count of <strong>d<\/strong>.<\/li>\n<li><strong>e<\/strong> occurs 4 times. <\/li>\n<li><strong>f<\/strong> occurs 2 times. <\/li>\n<\/ul>\n<p>Therefore, in output you need to print a string containing 4 times <strong>a<\/strong>, 1 time <strong>d<\/strong> , 4 times <strong>e<\/strong> and 2 times <strong>f<\/strong>, i.e., &quot;aaaadeeeeff&quot;, which is our output.<\/p>\n<h3>Approach and Algorithm<\/h3>\n<p>We need to traverse the list, and while traversing, if after a character node there is a number, then we need to extract that number and print the respective character the number of times equal to that extracted number.<\/p>\n<h5>Let&#8217;s see the algorithm<\/h5>\n<ul>\n<li>Traverse the list following the below steps.<\/li>\n<li>Store the character node in any variable and check for the next node.<br \/>\n1) If the next node is also a character that means the current character occurs only single time,<br \/>\n2) Else, if the next character is any value, extract that value and store that value in a variable count.<\/li>\n<li>Print the character count times.<\/li>\n<li>Now move to the next character node and repeat the above process for it.<\/li>\n<\/ul>\n<h3>Dry Run<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/prepbytes.com\/blog\/wp-content\/uploads\/2021\/08\/Run-Length-Decoding-in-Linked-List-1.png\" alt=\"\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/prepbytes.com\/blog\/wp-content\/uploads\/2021\/08\/Run-Length-Decoding-in-Linked-List-2.png\" alt=\"\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/prepbytes.com\/blog\/wp-content\/uploads\/2021\/08\/Run-Length-Decoding-in-Linked-List-3.png\" alt=\"\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/prepbytes.com\/blog\/wp-content\/uploads\/2021\/08\/Run-Length-Decoding-in-Linked-List-4.png\" alt=\"\" \/><\/p>\n<h3>Code Implementation<\/h3>\n\t\t\t\t\t\t<style>\r\n\t\t\t\t\r\n\t\t\t\t\t#tab_container_4250 {\r\n\toverflow:hidden;\r\n\tdisplay:block;\r\n\twidth:100%;\r\n\tborder:0px solid #ddd;\r\n\tmargin-bottom:30px;\r\n\t}\r\n\r\n#tab_container_4250 .tab-content{\r\n\tpadding:20px;\r\n\tborder: 1px solid #e6e6e6 !important;\r\n\tmargin-top: 0px;\r\n\tbackground-color:#ffffff !important;\r\n\tcolor: #000000 !important;\r\n\tfont-size:16px !important;\r\n\tfont-family: Open Sans !important;\r\n\t\r\n\t\tborder: 1px solid #e6e6e6 !important;\r\n\t}\r\n#tab_container_4250 .wpsm_nav-tabs {\r\n    border-bottom: 0px solid #ddd;\r\n}\r\n#tab_container_4250 .wpsm_nav-tabs > li.active > a, #tab_container_4250 .wpsm_nav-tabs > li.active > a:hover, #tab_container_4250 .wpsm_nav-tabs > li.active > a:focus {\r\n\tcolor: #000000 !important;\r\n\tcursor: default;\r\n\tbackground-color: #ffffff !important;\r\n\tborder: 1px solid #e6e6e6 !important;\r\n}\r\n\r\n#tab_container_4250 .wpsm_nav-tabs > li > a {\r\n    margin-right: 0px !important; \r\n    line-height: 1.42857143 !important;\r\n    border: 1px solid #d5d5d5 !important;\r\n    border-radius: 0px 0px 0 0 !important; \r\n\tbackground-color: #e8e8e8 !important;\r\n\tcolor: #000000 !important;\r\n\tpadding: 15px 18px 15px 18px !important;\r\n\ttext-decoration: none !important;\r\n\tfont-size: 14px !important;\r\n\ttext-align:center !important;\r\n\tfont-family: Open Sans !important;\r\n}\r\n#tab_container_4250 .wpsm_nav-tabs > li > a:focus {\r\noutline: 0px !important;\r\n}\r\n\r\n#tab_container_4250 .wpsm_nav-tabs > li > a:before {\r\n\tdisplay:none !important;\r\n}\r\n#tab_container_4250 .wpsm_nav-tabs > li > a:after {\r\n\tdisplay:none !important ;\r\n}\r\n#tab_container_4250 .wpsm_nav-tabs > li{\r\npadding:0px !important ;\r\nmargin:0px;\r\n}\r\n\r\n#tab_container_4250 .wpsm_nav-tabs > li > a:hover , #tab_container_4250 .wpsm_nav-tabs > li > a:focus {\r\n    color: #000000 !important;\r\n    background-color: #e8e8e8 !important;\r\n\tborder: 1px solid #d5d5d5 !important;\r\n\t\r\n}\r\n#tab_container_4250 .wpsm_nav-tabs > li > a .fa{\r\n\r\nmargin-right:5px !important;\r\n\r\nmargin-left:5px !important;\r\n\r\n\r\n}\r\n\r\n\t\t#tab_container_4250 .wpsm_nav-tabs a{\r\n\t\t\tbackground-image: none;\r\n\t\t\tbackground-position: 0 0;\r\n\t\t\tbackground-repeat: repeat-x;\r\n\t\t}\r\n\t\t\t\r\n\r\n\r\n#tab_container_4250 .wpsm_nav-tabs > li {\r\n    float: left;\r\n    margin-bottom: -1px !important;\r\n\tmargin-right:0px !important; \r\n}\r\n\r\n\r\n#tab_container_4250 .tab-content{\r\noverflow:hidden !important;\r\n}\r\n\r\n\r\n@media (min-width: 769px) {\r\n\r\n\t#tab_container_4250 .wpsm_nav-tabs > li{\r\n\t\tfloat:left !important ;\r\n\t\t\t\tmargin-right:-1px !important;\r\n\t\t\t\t\t}\r\n\t#tab_container_4250 .wpsm_nav-tabs{\r\n\t\tfloat:none !important;\r\n\t\tmargin:0px !important;\r\n\t}\r\n\r\n\t#tab_container_4250 .wpsm_nav-tabs > li {\r\n\t\t\t\t\r\n\t}\r\n\t#tab_container_4250 .wpsm_nav{\r\n\t\t\t}\r\n\r\n}\r\n\r\n\r\n\r\n@media (max-width: 768px) {\r\n\t#tab_container_4250 .wpsm_nav-tabs > li {\r\n\t\t\t\t\r\n\t}\r\n\t#tab_container_4250 .wpsm_nav{\r\n\t\t\t}\r\n}\r\n\r\n\r\n\t.wpsm_nav-tabs li:before{\r\n\t\tdisplay:none !important;\r\n\t}\r\n\r\n\t@media (max-width: 768px) {\r\n\t\t\t\t\r\n\t\t\t\t.wpsm_nav-tabs{\r\n\t\t\tmargin-left:0px !important;\r\n\t\t\tmargin-right:0px !important; \r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t#tab_container_4250 .wpsm_nav-tabs > li{\r\n\t\t\tfloat:none !important;\r\n\t\t}\r\n\t\t\t\r\n\t}\t\t\t\t<\/style>\r\n\t\t\t\t<div id=\"tab_container_4250\" >\r\n\t \r\n\t\t\t\t\t<ul class=\"wpsm_nav wpsm_nav-tabs\" role=\"tablist\" id=\"myTab_4250\">\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<li role=\"presentation\"  class=\"active\"  onclick=\"do_resize()\">\r\n\t\t\t\t\t\t\t\t<a href=\"#tabs_desc_4250_1\" aria-controls=\"tabs_desc_4250_1\" role=\"tab\" data-toggle=\"tab\">\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i class=\"fa fa-code\"><\/i> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t<span>C++<\/span>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<\/a>\r\n\t\t\t\t\t\t\t<\/li>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<li role=\"presentation\"  onclick=\"do_resize()\">\r\n\t\t\t\t\t\t\t\t<a href=\"#tabs_desc_4250_2\" aria-controls=\"tabs_desc_4250_2\" role=\"tab\" data-toggle=\"tab\">\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i class=\"fa fa-code\"><\/i> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t<span>Java<\/span>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<\/a>\r\n\t\t\t\t\t\t\t<\/li>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<li role=\"presentation\"  onclick=\"do_resize()\">\r\n\t\t\t\t\t\t\t\t<a href=\"#tabs_desc_4250_3\" aria-controls=\"tabs_desc_4250_3\" role=\"tab\" data-toggle=\"tab\">\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i class=\"fa fa-code\"><\/i> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t<span>Python<\/span>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<\/a>\r\n\t\t\t\t\t\t\t<\/li>\r\n\t\t\t\t\t\t\t\t\t\t\t <\/ul>\r\n\r\n\t\t\t\t\t  <!-- Tab panes -->\r\n\t\t\t\t\t  <div class=\"tab-content\" id=\"tab-content_4250\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t <div role=\"tabpanel\" class=\"tab-pane  in active \" id=\"tabs_desc_4250_1\">\r\n\t\t\t\t\t\t\t\t<!-- wp:enlighter\/codeblock {\"language\":\"cpp\"} -->\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\r\n#include&lt;bits stdc++.h=&quot;&quot;&gt;\r\nusing namespace std;\r\n\r\nclass Node {\r\npublic:\r\n    char data;\r\n    Node* next;\r\n\r\n    Node(char x) {\r\n        data = x;\r\n        next = NULL;\r\n    }\r\n};\r\nstring decodeList(Node* head) {\r\n    Node* current_node = head;\r\n    int count; \/\/ to store the count a particular character needs to be printed.\r\n    string decodedString = &quot;&quot;; \/\/ resultant string after decoding\r\n    while (current_node) {\r\n        count = 0;\r\n        char current_char = current_node-&gt;data;\r\n\r\n        \/\/If it is not last node, we need to check for next node.\r\n        if (current_node-&gt;next) {\r\n            Node* next_node = current_node-&gt;next;\r\n\r\n            \/\/If the next node is any numeric value , we need to extract it.\r\n            if (next_node &amp;&amp; next_node-&gt;data &gt;= '0' &amp;&amp; next_node-&gt;data &lt;= '9') {\r\n\r\n                \/\/ Why while loop ? =&gt; it can be multi-digit number also. Take an example (a-&gt;1-&gt;2-&gt;3-&gt;v-&gt;2-2). This means a occurs 123 times and v 22 times.\r\n                while (next_node &amp;&amp; next_node-&gt;data &gt;= '0' &amp;&amp; next_node-&gt;data &lt;= '9') {\r\n                    count = count * 10 + (next_node-&gt;data - '0');\r\n                    next_node = next_node-&gt;next;\r\n                }\r\n                current_node = next_node;\r\n            }\r\n            \/\/ If it is not numeric value, the character occurs only once. So count = 1.\r\n            else {\r\n                count = 1;\r\n                current_node = current_node-&gt;next;\r\n            }\r\n        }\r\n        \/\/For last node.\r\n        else {\r\n            count = 1;\r\n            current_node = current_node-&gt;next;\r\n        }\r\n\r\n\r\n        \/\/Appending the characters count times, in the resultant string.\r\n        for (int i = 0; i &lt; count; i++) {\r\n            decodedString += current_char;\r\n        }\r\n    }\r\n\r\n    \/\/Finally Returning the output string.\r\n    return decodedString;\r\n}\r\nint main() {\r\n    Node* head = new Node('a');\r\n    head-&gt;next = new Node('4');\r\n    head-&gt;next-&gt;next = new Node('d');\r\n    head-&gt;next-&gt;next-&gt;next = new Node('e');\r\n    head-&gt;next-&gt;next-&gt;next-&gt;next = new Node('4');\r\n    head-&gt;next-&gt;next-&gt;next-&gt;next-&gt;next = new Node('f');\r\n    head-&gt;next-&gt;next-&gt;next-&gt;next-&gt;next-&gt;next = new Node('2');\r\n\r\n    \/\/To keep the implementation simple, we are adding nodes in such a way. Instead of this, we can also use append method.\r\n\r\n\r\n    cout &lt;&lt; decodeList(head);\r\n}\r\n<\/pre>\r\n<!-- \/wp:enlighter\/codeblock -->\r\n\t\t\t\t\t\t <\/div>\r\n\t\t\t\t\t\t\t\t\t\t\t\t <div role=\"tabpanel\" class=\"tab-pane \" id=\"tabs_desc_4250_2\">\r\n\t\t\t\t\t\t\t\t<!-- wp:enlighter\/codeblock {\"language\":\"java\"} -->\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\r\nclass Decode \r\n{\r\n\tstatic class Node \r\n    {\r\n\t\tchar data;\r\n\t\tNode next;\r\n\t};\r\n\r\n\t\/\/ Utility function to create a new Node\r\n\tstatic Node newNode(char data)\r\n\t{\r\n\t\tNode temp = new Node();\r\n\t\ttemp.data = data;\r\n\t\ttemp.next = null;\r\n\r\n\t\treturn temp;\r\n\t}\r\n\t\/\/ Function to append nodes to a list\r\n\tstatic void append(Node head_ref, char new_data)\r\n\t{\r\n\t\tNode new_node = new Node();\r\n\r\n\t\tNode last = head_ref;\r\n\r\n\t\tnew_node.data = new_data;\r\n\r\n\t\tnew_node.next = null;\r\n\r\n\t\tif (head_ref == null) {\r\n\t\t\thead_ref = new_node;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\twhile (last.next != null)\r\n\t\t\tlast = last.next;\r\n\r\n\t\tlast.next = new_node;\r\n\t\treturn;\r\n\t}\r\n\r\n\t\/\/ Function to print list\r\n\tstatic void printList(Node node)\r\n\t{\r\n\t\twhile (node != null) {\r\n\t\t\tSystem.out.print(node.data + &quot; &quot;);\r\n\r\n\t\t\tnode = node.next;\r\n\t\t}\r\n\t}\r\n\r\n\t\/\/ Function to decode the linked list\r\n\tstatic String decodeList(Node head)\r\n\t{\r\n\t\t\/\/ Pointer used to traverse through all\r\n\t\t\/\/ the nodes in the list\r\n\t\tNode p = head;\r\n\r\n\t\t\/\/ String to store the decoded message\r\n\t\tString res = &quot;&quot;;\r\n\r\n\t\tint count;\r\n\r\n\t\t\/\/ While there are nodes left\r\n\t\twhile (p != null) {\r\n\r\n\t\t\t\/\/ To store the count by which the current\r\n\t\t\t\/\/ character needs to be repeated\r\n\t\t\tcount = 0;\r\n\r\n\t\t\t\/\/ Get the current character\r\n\t\t\tchar c = p.data;\r\n\t\t\tif (p.next != null) {\r\n\t\t\t\tNode temp = p.next;\r\n\r\n\t\t\t\t\/\/ If current node is a digit\r\n\t\t\t\tif (temp != null &amp;&amp; temp.data &gt;= '0'\r\n\t\t\t\t\t&amp;&amp; temp.data &lt;= '9') {\r\n\r\n\t\t\t\t\t\/\/ Generate the integer from\r\n\t\t\t\t\t\/\/ the consecutive digits\r\n\t\t\t\t\twhile (temp != null &amp;&amp; temp.data &gt;= '0'\r\n\t\t\t\t\t\t&amp;&amp; temp.data &lt;= '9') {\r\n\t\t\t\t\t\tcount = count * 10 + (temp.data - '0');\r\n\t\t\t\t\t\ttemp = temp.next;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tp = temp;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tcount = 1;\r\n\t\t\t\t\tp = p.next;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tcount = 1;\r\n\t\t\t\tp = p.next;\r\n\t\t\t}\r\n\r\n\t\t\t\/\/ Repeat the character count times\r\n\t\t\tfor (int i = 0; i &lt; count; i++) {\r\n\t\t\t\tres += c;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn res;\r\n\t}\r\n\t\/\/ Driver code\r\n\tpublic static void main(String args[])\r\n\t{\r\n\r\n\t\tNode head = newNode('a');\r\n\t\thead.next = newNode('4');\r\n\t\thead.next.next = newNode('d');\r\n\t\thead.next.next.next = newNode('e');\r\n        head.next.next.next.next = newNode('4');\r\n        head.next.next.next.next.next = newNode('f');\r\n        head.next.next.next.next.next.next = newNode('2');\r\n\r\n\t\tSystem.out.println(decodeList(head));\r\n\t}\r\n}\r\n\r\n<\/pre>\r\n<!-- \/wp:enlighter\/codeblock -->\r\n\t\t\t\t\t\t <\/div>\r\n\t\t\t\t\t\t\t\t\t\t\t\t <div role=\"tabpanel\" class=\"tab-pane \" id=\"tabs_desc_4250_3\">\r\n\t\t\t\t\t\t\t\t<!-- wp:enlighter\/codeblock {\"language\":\"python\"} -->\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\r\n# Linked list node\r\nclass Node:\r\n\tdef __init__(self, data):\t\r\n\t\tself.data = data\r\n\t\tself.next = None\r\n\r\n# Utility function to create a Node\r\ndef newNode(data):\r\n\ttemp = Node(data);\r\n\ttemp.next = None;\r\n\r\n\treturn temp;\r\n\r\n# Function to append nodes to a list\r\ndef append(head_ref, new_data):\r\n\tnew_node = Node;\r\n\tlast = head_ref;\r\n\tnew_node.data = new_data;\r\n\tnew_node.next = None;\r\n\tif (head_ref == None):\r\n\t\thead_ref = new_node;\r\n\t\treturn;\r\n\twhile (last.next != None):\r\n\t\tlast = last.next;\r\n\tlast.next = new_node;\r\n\treturn;\r\n\r\n# Function to print list\r\ndef printList(node):\r\n\twhile (node != None):\t\r\n\t\tprint(node.data, end = ' ')\r\n\t\tnode = node.next;\r\n\t\r\n# Function to decode the linked list\r\ndef decodeList(head):\r\n\tp = head;\r\n\tres = &quot;&quot;;\r\n\tcount = 0\r\n\r\n\t# While there are nodes left\r\n\twhile (p != None):\r\n\r\n\t\t# To store the count by which the current\r\n\t\t# character needs to be repeated\r\n\t\tcount = 0;\r\n\r\n\t\t# Get the current character\r\n\t\tc = p.data;\r\n\t\tif (p.next != None):\r\n\t\t\t\r\n\t\t\ttemp = p.next;\r\n\r\n\t\t\t# If current node is a digit\r\n\t\t\tif (temp != None and ord(temp.data) &gt;= ord('0')\r\n\t\t\t\tand ord(temp.data) &lt;= ord('9')):\r\n\r\n\t\t\t\t# Generate the integer from\r\n\t\t\t\t# the consecutive digits\r\n\t\t\t\twhile (temp != None and ord(temp.data) &gt;= ord('0')\r\n\t\t\t\t\tand ord(temp.data) &lt;= ord('9')):\r\n\t\t\t\t\tcount = count * 10 + ord(temp.data) - ord('0')\r\n\t\t\t\t\ttemp = temp.next;\r\n\t\t\t\r\n\t\t\t\tp = temp;\r\n\t\t\t\r\n\t\t\telse:\r\n\t\t\t\tcount = 1;\r\n\t\t\t\tp = p.next;\t\t\r\n\t\telse:\r\n\t\t\tcount = 1;\r\n\t\t\tp = p.next;\r\n\t\t\r\n\t\t# Repeat the character count times\r\n\t\tfor i in range(0, count):\t\r\n\t\t\tres += c;\r\n\treturn res;\r\n\r\nif __name__=='__main__':\r\n\t\r\n\t# Creating the linked list\r\n\thead = newNode('a');\r\n\thead.next = newNode('4');\r\n\thead.next.next = newNode('d');\r\n\thead.next.next.next = newNode('e');\r\n\thead.next.next.next.next = newNode('4');\r\n\thead.next.next.next.next.next = newNode('f');\r\n\thead.next.next.next.next.next.next = newNode('2');\r\n\r\n\tprint(decodeList(head))\r\n<\/pre>\r\n<!-- \/wp:enlighter\/codeblock -->\r\n\t\t\t\t\t\t <\/div>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t <\/div>\r\n\t\t\t\t\t \r\n\t\t\t\t <\/div>\r\n <script>\r\n\t\tjQuery(function () {\r\n\t\t\tjQuery('#myTab_4250 a:first').tab('show')\r\n\t\t});\r\n\t\t\r\n\t\t\t\tjQuery(function(){\r\n\t\t\tvar b=\"fadeIn\";\r\n\t\t\tvar c;\r\n\t\t\tvar a;\r\n\t\t\td(jQuery(\"#myTab_4250 a\"),jQuery(\"#tab-content_4250\"));function d(e,f,g){\r\n\t\t\t\te.click(function(i){\r\n\t\t\t\t\ti.preventDefault();\r\n\t\t\t\t\tjQuery(this).tab(\"show\");\r\n\t\t\t\t\tvar h=jQuery(this).data(\"easein\");\r\n\t\t\t\t\tif(c){c.removeClass(a);}\r\n\t\t\t\t\tif(h){f.find(\"div.active\").addClass(\"animated \"+h);a=h;}\r\n\t\t\t\t\telse{if(g){f.find(\"div.active\").addClass(\"animated \"+g);a=g;}else{f.find(\"div.active\").addClass(\"animated \"+b);a=b;}}c=f.find(\"div.active\");\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\r\n\t\tfunction do_resize(){\r\n\r\n\t\t\tvar width=jQuery( '.tab-content .tab-pane iframe' ).width();\r\n\t\t\tvar height=jQuery( '.tab-content .tab-pane iframe' ).height();\r\n\r\n\t\t\tvar toggleSize = true;\r\n\t\t\tjQuery('iframe').animate({\r\n\t\t\t    width: toggleSize ? width : 640,\r\n\t\t\t    height: toggleSize ? height : 360\r\n\t\t\t  }, 250);\r\n\r\n\t\t\t  toggleSize = !toggleSize;\r\n\t\t}\r\n\r\n\r\n\t<\/script>\r\n\t\t\t\t\r\n\t\t\t\n<h4>Output<\/h4>\n<p>aaaadeeeeff<\/p>\n<p><strong>Time Complexity:<\/strong> O(n), where n is the number of nodes in the given LinkedList.<br \/>\n[forminator_quiz id=&#8221;4251&#8243;]<\/p>\n<p>This blog tried to discuss the problem when we are given an encoded string in the form of linkedlist and we were required to decode it.  If you want to solve more questions on Linked List, which are curated by our expert mentors at PrepBytes, you can follow this link <a href=\"https:\/\/mycode.prepbytes.com\/interview-coding\/practice\/linked-list\">Linked List<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction The linked list is one of the most important concepts and data structures to learn while preparing for interviews. Having a good grasp of Linked Lists can be a huge plus point in a coding interview. Problem Statement We will be provided with a Linked List in encoded form (like a4de4f2) and we need [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[125],"tags":[],"class_list":["post-4249","post","type-post","status-publish","format-standard","hentry","category-linked-list"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>&quot;Run Length Decoding in Linked List from the Run length encoded list&quot;<\/title>\n<meta name=\"description\" content=\"Given an encoded Linked List which is encoded using the Run Length Encoding algorithm. The task is to decode the given linked list and generate the input string.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"&quot;Run Length Decoding in Linked List from the Run length encoded list&quot;\" \/>\n<meta property=\"og:description\" content=\"Given an encoded Linked List which is encoded using the Run Length Encoding algorithm. The task is to decode the given linked list and generate the input string.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/\" \/>\n<meta property=\"og:site_name\" content=\"PrepBytes Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prepbytes0211\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-24T17:18:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-03-09T08:05:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1644926152813-110.Run%20Length%20Decoding%20in%20Linked%20List-05.png\" \/>\n<meta name=\"author\" content=\"PrepBytes\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"PrepBytes\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/\"},\"author\":{\"name\":\"PrepBytes\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/person\/39fcf072e04987f16796546f2ca83c2e\"},\"headline\":\"Run Length Decoding in Linked List\",\"datePublished\":\"2021-08-24T17:18:22+00:00\",\"dateModified\":\"2022-03-09T08:05:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/\"},\"wordCount\":623,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/43.205.93.38\/#organization\"},\"image\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1644926152813-110.Run%20Length%20Decoding%20in%20Linked%20List-05.png\",\"articleSection\":[\"Linked list articles\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/\",\"url\":\"https:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/\",\"name\":\"\\\"Run Length Decoding in Linked List from the Run length encoded list\\\"\",\"isPartOf\":{\"@id\":\"http:\/\/43.205.93.38\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1644926152813-110.Run%20Length%20Decoding%20in%20Linked%20List-05.png\",\"datePublished\":\"2021-08-24T17:18:22+00:00\",\"dateModified\":\"2022-03-09T08:05:03+00:00\",\"description\":\"Given an encoded Linked List which is encoded using the Run Length Encoding algorithm. The task is to decode the given linked list and generate the input string.\",\"breadcrumb\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/#primaryimage\",\"url\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1644926152813-110.Run%20Length%20Decoding%20in%20Linked%20List-05.png\",\"contentUrl\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1644926152813-110.Run%20Length%20Decoding%20in%20Linked%20List-05.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/43.205.93.38\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Linked list articles\",\"item\":\"https:\/\/prepbytes.com\/blog\/category\/linked-list\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Run Length Decoding in Linked List\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/43.205.93.38\/#website\",\"url\":\"http:\/\/43.205.93.38\/\",\"name\":\"PrepBytes Blog\",\"description\":\"ONE-STOP RESOURCE FOR EVERYTHING RELATED TO CODING\",\"publisher\":{\"@id\":\"http:\/\/43.205.93.38\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/43.205.93.38\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/43.205.93.38\/#organization\",\"name\":\"Prepbytes\",\"url\":\"http:\/\/43.205.93.38\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp\",\"contentUrl\":\"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp\",\"width\":160,\"height\":160,\"caption\":\"Prepbytes\"},\"image\":{\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/prepbytes0211\/\",\"https:\/\/www.instagram.com\/prepbytes\/\",\"https:\/\/www.linkedin.com\/company\/prepbytes\/\",\"https:\/\/www.youtube.com\/channel\/UC0xGnHDrjUM1pDEK2Ka5imA\"]},{\"@type\":\"Person\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/person\/39fcf072e04987f16796546f2ca83c2e\",\"name\":\"PrepBytes\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/850669d326db1e1531f04db0c63145d941c2a26792aaeee226a9e6675b0ac698?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/850669d326db1e1531f04db0c63145d941c2a26792aaeee226a9e6675b0ac698?s=96&d=mm&r=g\",\"caption\":\"PrepBytes\"},\"url\":\"https:\/\/prepbytes.com\/blog\/author\/prepbytes\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\"Run Length Decoding in Linked List from the Run length encoded list\"","description":"Given an encoded Linked List which is encoded using the Run Length Encoding algorithm. The task is to decode the given linked list and generate the input string.","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:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/","og_locale":"en_US","og_type":"article","og_title":"\"Run Length Decoding in Linked List from the Run length encoded list\"","og_description":"Given an encoded Linked List which is encoded using the Run Length Encoding algorithm. The task is to decode the given linked list and generate the input string.","og_url":"https:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/","og_site_name":"PrepBytes Blog","article_publisher":"https:\/\/www.facebook.com\/prepbytes0211\/","article_published_time":"2021-08-24T17:18:22+00:00","article_modified_time":"2022-03-09T08:05:03+00:00","og_image":[{"url":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1644926152813-110.Run%20Length%20Decoding%20in%20Linked%20List-05.png","type":"","width":"","height":""}],"author":"PrepBytes","twitter_card":"summary_large_image","twitter_misc":{"Written by":"PrepBytes","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/#article","isPartOf":{"@id":"https:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/"},"author":{"name":"PrepBytes","@id":"http:\/\/43.205.93.38\/#\/schema\/person\/39fcf072e04987f16796546f2ca83c2e"},"headline":"Run Length Decoding in Linked List","datePublished":"2021-08-24T17:18:22+00:00","dateModified":"2022-03-09T08:05:03+00:00","mainEntityOfPage":{"@id":"https:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/"},"wordCount":623,"commentCount":0,"publisher":{"@id":"http:\/\/43.205.93.38\/#organization"},"image":{"@id":"https:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/#primaryimage"},"thumbnailUrl":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1644926152813-110.Run%20Length%20Decoding%20in%20Linked%20List-05.png","articleSection":["Linked list articles"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/","url":"https:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/","name":"\"Run Length Decoding in Linked List from the Run length encoded list\"","isPartOf":{"@id":"http:\/\/43.205.93.38\/#website"},"primaryImageOfPage":{"@id":"https:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/#primaryimage"},"image":{"@id":"https:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/#primaryimage"},"thumbnailUrl":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1644926152813-110.Run%20Length%20Decoding%20in%20Linked%20List-05.png","datePublished":"2021-08-24T17:18:22+00:00","dateModified":"2022-03-09T08:05:03+00:00","description":"Given an encoded Linked List which is encoded using the Run Length Encoding algorithm. The task is to decode the given linked list and generate the input string.","breadcrumb":{"@id":"https:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/#primaryimage","url":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1644926152813-110.Run%20Length%20Decoding%20in%20Linked%20List-05.png","contentUrl":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1644926152813-110.Run%20Length%20Decoding%20in%20Linked%20List-05.png"},{"@type":"BreadcrumbList","@id":"https:\/\/prepbytes.com\/blog\/run-length-decoding-in-linked-list\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/43.205.93.38\/"},{"@type":"ListItem","position":2,"name":"Linked list articles","item":"https:\/\/prepbytes.com\/blog\/category\/linked-list\/"},{"@type":"ListItem","position":3,"name":"Run Length Decoding in Linked List"}]},{"@type":"WebSite","@id":"http:\/\/43.205.93.38\/#website","url":"http:\/\/43.205.93.38\/","name":"PrepBytes Blog","description":"ONE-STOP RESOURCE FOR EVERYTHING RELATED TO CODING","publisher":{"@id":"http:\/\/43.205.93.38\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/43.205.93.38\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/43.205.93.38\/#organization","name":"Prepbytes","url":"http:\/\/43.205.93.38\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/","url":"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp","contentUrl":"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp","width":160,"height":160,"caption":"Prepbytes"},"image":{"@id":"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/prepbytes0211\/","https:\/\/www.instagram.com\/prepbytes\/","https:\/\/www.linkedin.com\/company\/prepbytes\/","https:\/\/www.youtube.com\/channel\/UC0xGnHDrjUM1pDEK2Ka5imA"]},{"@type":"Person","@id":"http:\/\/43.205.93.38\/#\/schema\/person\/39fcf072e04987f16796546f2ca83c2e","name":"PrepBytes","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/43.205.93.38\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/850669d326db1e1531f04db0c63145d941c2a26792aaeee226a9e6675b0ac698?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/850669d326db1e1531f04db0c63145d941c2a26792aaeee226a9e6675b0ac698?s=96&d=mm&r=g","caption":"PrepBytes"},"url":"https:\/\/prepbytes.com\/blog\/author\/prepbytes\/"}]}},"_links":{"self":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts\/4249","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/comments?post=4249"}],"version-history":[{"count":8,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts\/4249\/revisions"}],"predecessor-version":[{"id":7841,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts\/4249\/revisions\/7841"}],"wp:attachment":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/media?parent=4249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/categories?post=4249"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/tags?post=4249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}