{"id":351351,"date":"2024-05-20T12:31:38","date_gmt":"2024-05-20T12:31:38","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=351351"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=351351","title":{"rendered":"<span>LeetCode 2532 (Hard++, Extra Category, Amazon). Time to Cross a Bridge. Swift solution<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h3>Description<\/h3>\n<p>There are\u00a0<code>k<\/code>\u00a0workers who want to move\u00a0<code>n<\/code>\u00a0boxes from an old warehouse to a new one. You are given the two integers\u00a0<code>n<\/code>\u00a0and\u00a0<code>k<\/code>, and a 2D integer array\u00a0<code>time<\/code>\u00a0of size\u00a0<code>k x 4<\/code>\u00a0where\u00a0<code>time[i] = [leftToRighti, pickOldi, rightToLefti, putNewi]<\/code>.<\/p>\n<p>The warehouses are separated by a river and connected by a bridge. The old warehouse is on the right bank of the river, and the new warehouse is on the left bank of the river. Initially, all\u00a0<code>k<\/code>\u00a0workers are waiting on the left side of the bridge. To move the boxes, the\u00a0<code>i<\/code>-th worker (<strong>0-indexed<\/strong>) can :<\/p>\n<ul>\n<li>\n<p>Cross the bridge from the left bank (new warehouse) to the right bank (old warehouse) in\u00a0<code>leftToRighti<\/code>\u00a0minutes.<\/p>\n<\/li>\n<li>\n<p>Pick a box from the old warehouse and return to the bridge in\u00a0<code>pickOldi<\/code>\u00a0minutes. Different workers can pick up their boxes simultaneously.<\/p>\n<\/li>\n<li>\n<p>Cross the bridge from the right bank (old warehouse) to the left bank (new warehouse) in\u00a0<code>rightToLefti<\/code>\u00a0minutes.<\/p>\n<\/li>\n<li>\n<p>Put the box in the new warehouse and return to the bridge in\u00a0<code>putNewi<\/code>\u00a0minutes. Different workers can put their boxes simultaneously.<\/p>\n<\/li>\n<\/ul>\n<p>A worker\u00a0<code>i<\/code>\u00a0is less efficient than a worker\u00a0<code>j<\/code>\u00a0if either condition is met:<\/p>\n<ul>\n<li>\n<p><code>leftToRighti + rightToLefti > leftToRightj + rightToLeftj<\/code><\/p>\n<\/li>\n<li>\n<p><code>leftToRighti + rightToLefti == leftToRightj + rightToLeftj<\/code>\u00a0and\u00a0<code>i > j<\/code><\/p>\n<\/li>\n<\/ul>\n<p>The following rules regulate the movement of the workers through the bridge:<\/p>\n<ul>\n<li>\n<p>If a worker\u00a0<code>x<\/code>\u00a0reaches the bridge while another worker\u00a0<code>y<\/code>\u00a0is crossing the bridge,\u00a0<code>x<\/code>\u00a0waits at their side of the bridge.<\/p>\n<\/li>\n<li>\n<p>If the bridge is free, the worker waiting on the right side of the bridge gets to cross the bridge. If more than one worker is waiting on the right side, the one with the\u00a0<strong>lowest efficiency<\/strong>\u00a0crosses first.<\/p>\n<\/li>\n<li>\n<p>If the bridge is free and no worker is waiting on the right side, and at least one box remains at the old warehouse, the worker on the left side of the river gets to cross the bridge. If more than one worker is waiting on the left side, the one with the lowest efficiency crosses first.<\/p>\n<\/li>\n<\/ul>\n<p><strong><em><u>Return<\/u><\/em><\/strong><em>\u00a0the instance of time at which the last worker reaches the left bank of the river after all n boxes have been put in the new warehouse.<\/em><\/p>\n<p>Example 1:<\/p>\n<pre><code>Input: n = 1, k = 3, time = [[1,1,2,1],[1,1,3,1],[1,1,4,1]] Output: 6 Explanation:  From 0 to 1: worker 2 crosses the bridge from the left bank to the right bank. From 1 to 2: worker 2 picks up a box from the old warehouse. From 2 to 6: worker 2 crosses the bridge from the right bank to the left bank. From 6 to 7: worker 2 puts a box at the new warehouse. The whole process ends after 7 minutes. We return 6 because the problem asks for the instance of time at which the last worker reaches the left bank.<\/code><\/pre>\n<p>Example 2:<\/p>\n<pre><code>Input: n = 3, k = 2, time = [[1,9,1,8],[10,10,10,10]] Output: 50 Explanation:  From 0  to 10: worker 1 crosses the bridge from the left bank to the right bank. From 10 to 20: worker 1 picks up a box from the old warehouse. From 10 to 11: worker 0 crosses the bridge from the left bank to the right bank. From 11 to 20: worker 0 picks up a box from the old warehouse. From 20 to 30: worker 1 crosses the bridge from the right bank to the left bank. From 30 to 40: worker 1 puts a box at the new warehouse. From 30 to 31: worker 0 crosses the bridge from the right bank to the left bank. From 31 to 39: worker 0 puts a box at the new warehouse. From 39 to 40: worker 0 crosses the bridge from the left bank to the right bank. From 40 to 49: worker 0 picks up a box from the old warehouse. From 49 to 50: worker 0 crosses the bridge from the right bank to the left bank. From 50 to 58: worker 0 puts a box at the new warehouse. The whole process ends after 58 minutes. We return 50 because the problem asks for the instance of time at which the last worker reaches the left bank.<\/code><\/pre>\n<p><strong>Constraints<\/strong>:<br \/>1 &lt;= n, k &lt;= 10^4<br \/>time.length == k<br \/>time[i].length == 4<br \/>1 &lt;= leftToRighti, pickOldi, rightToLefti, putNewi &lt;= 1000<\/p>\n<h3>Approach<\/h3>\n<p>The main for-loop in the code handles the following steps:<\/p>\n<ol>\n<li>\n<p>Update the waiting list on the bridge.<\/p>\n<\/li>\n<li>\n<p>Pick a worker to pass the bridge based on the defined conditions.<\/p>\n<\/li>\n<li>\n<p>Advance the time.<\/p>\n<\/li>\n<li>\n<p>Update the count of remaining boxes that need to be moved.<\/p>\n<\/li>\n<\/ol>\n<p>Noteworthy points:<\/p>\n<ol>\n<li>\n<p>When there are enough workers on the right bank, workers on the left side should not pass the bridge.<\/p>\n<\/li>\n<li>\n<p>When there are no workers waiting to cross the bridge on either side, the time is moved to the next moment when a worker could potentially be waiting to cross.<\/p>\n<\/li>\n<\/ol>\n<h3>Code (Swift)<\/h3>\n<p>Overflow checks have been taken into consideration. The maximum time to move a box is at most 4 * 1000 (four steps to move the box, each taking 1000 time). With at most 1e4 boxes, the total time is at most 4e7, ensuring the solution is safe.<\/p>\n<pre><code class=\"swift\">class Solution {      func findCrossingTime(_ n: Int, _ k: Int, _ time: [[Int]]) -> Int {         var lBank = PriorityQueue&lt;Int>(comparator: { (a, b) -> Bool in             let ta = time[a]             let tb = time[b]             let ca = ta[0] + ta[2]             let cb = tb[0] + tb[2]             if ca == cb { return b &lt; a }  \/\/ larger index cross first             return cb &lt; ca  \/\/ larger cross time cross first         })         var rBank = PriorityQueue&lt;Int>(comparator: { (a, b) -> Bool in             let ta = time[a]             let tb = time[b]             let ca = ta[0] + ta[2]             let cb = tb[0] + tb[2]             if ca == cb { return b &lt; a }  \/\/ larger index cross first             return cb &lt; ca  \/\/ larger cross time cross first         })          \/\/ 0 -> time of the worker will be waiting to cross the bridge, 1 ->idx         var lWorker = PriorityQueue&lt;(Int, Int)>(comparator: { (a, b) -> Bool in a.0 &lt; b.0 })         var rWorker = PriorityQueue&lt;(Int, Int)>(comparator: { (a, b) -> Bool in a.0 &lt; b.0 })          \/\/ initially, all at left bank         for i in 0..&lt;k {             lBank.add(i)         }          var curTime = 0         var remainingBoxes = n         while remainingBoxes > 0 {             \/\/ process worker             while !lWorker.isEmpty &amp;&amp; lWorker.peek()!.0 &lt;= curTime {                 lBank.add(lWorker.poll()!.1)             }             while !rWorker.isEmpty &amp;&amp; rWorker.peek()!.0 &lt;= curTime {                 rBank.add(rWorker.poll()!.1)             }              var worker = -1             if !rBank.isEmpty {                 \/\/ right side can pass, a box will be put                 worker = rBank.poll()!                 let t = time[worker]                 lWorker.add((curTime + t[2] + t[3], worker))                 curTime += t[2]  \/\/ right to left                  remainingBoxes -= 1             } else if !lBank.isEmpty &amp;&amp; (remainingBoxes > rBank.size + rWorker.size) {                 \/\/ left side can pass                 \/\/ left side only pass when there are more boxes                 worker = lBank.poll()!                 let t = time[worker]                 rWorker.add((curTime + t[0] + t[1], worker))                 curTime += t[0]  \/\/ left to right             } else if remainingBoxes == rBank.size + rWorker.size {                 curTime = rWorker.peek()!.0             } else {                 \/\/ if still empty, advance time                 let nxt: Int                 if rWorker.isEmpty {                     nxt = lWorker.peek()!.0                 } else if lWorker.isEmpty {                     nxt = rWorker.peek()!.0                 } else {                     nxt = min(lWorker.peek()!.0, rWorker.peek()!.0)                 }                  curTime = nxt             }         }          return curTime     } }  \/\/ Wrapper class for PriorityQueue struct PriorityQueue&lt;Element> {     private var heap: [Element]     private let comparator: (Element, Element) -> Bool      init(comparator: @escaping (Element, Element) -> Bool) {         self.heap = []         self.comparator = comparator     }      var isEmpty: Bool {         return heap.isEmpty     }      var size: Int {         return heap.count     }      func peek() -> Element? {         return heap.first     }      mutating func add(_ element: Element) {         heap.append(element)         swim(heap.count - 1)     }      mutating func poll() -> Element? {         if heap.isEmpty { return nil }         if heap.count == 1 { return heap.removeFirst() }          heap.swapAt(0, heap.count - 1)         let element = heap.removeLast()         sink(0)          return element     }      private mutating func swim(_ index: Int) {         var childIndex = index         var parentIndex = (childIndex - 1) \/ 2          while childIndex > 0 &amp;&amp; comparator(heap[childIndex], heap[parentIndex]) {             heap.swapAt(childIndex, parentIndex)             childIndex = parentIndex             parentIndex = (childIndex - 1) \/ 2         }     }      private mutating func sink(_ index: Int) {         var parentIndex = index          while true {             let leftChildIndex = 2 * parentIndex + 1             let rightChildIndex = 2 * parentIndex + 2             var candidateIndex = parentIndex              if leftChildIndex &lt; heap.count &amp;&amp; comparator(heap[leftChildIndex], heap[candidateIndex])             {                 candidateIndex = leftChildIndex             }             if rightChildIndex &lt; heap.count                 &amp;&amp; comparator(heap[rightChildIndex], heap[candidateIndex])             {                 candidateIndex = rightChildIndex             }              if candidateIndex == parentIndex {                 return             }              heap.swapAt(parentIndex, candidateIndex)             parentIndex = candidateIndex         }     } }<\/code><\/pre>\n<p>Sources:\u00a0<a href=\"https:\/\/github.com\/sergeyleschev\/leetcode-swift\/blob\/main\/2501-3000\/2532.%20Time%20to%20Cross%20a%20Bridge.swift\" rel=\"noopener noreferrer nofollow\"><u>Github<\/u><\/a><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/752698\/\"> https:\/\/habr.com\/ru\/articles\/752698\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h3>Description<\/h3>\n<p>There are\u00a0<code>k<\/code>\u00a0workers who want to move\u00a0<code>n<\/code>\u00a0boxes from an old warehouse to a new one. You are given the two integers\u00a0<code>n<\/code>\u00a0and\u00a0<code>k<\/code>, and a 2D integer array\u00a0<code>time<\/code>\u00a0of size\u00a0<code>k x 4<\/code>\u00a0where\u00a0<code>time[i] = [leftToRighti, pickOldi, rightToLefti, putNewi]<\/code>.<\/p>\n<p>The warehouses are separated by a river and connected by a bridge. The old warehouse is on the right bank of the river, and the new warehouse is on the left bank of the river. Initially, all\u00a0<code>k<\/code>\u00a0workers are waiting on the left side of the bridge. To move the boxes, the\u00a0<code>i<\/code>-th worker (<strong>0-indexed<\/strong>) can :<\/p>\n<ul>\n<li>\n<p>Cross the bridge from the left bank (new warehouse) to the right bank (old warehouse) in\u00a0<code>leftToRighti<\/code>\u00a0minutes.<\/p>\n<\/li>\n<li>\n<p>Pick a box from the old warehouse and return to the bridge in\u00a0<code>pickOldi<\/code>\u00a0minutes. Different workers can pick up their boxes simultaneously.<\/p>\n<\/li>\n<li>\n<p>Cross the bridge from the right bank (old warehouse) to the left bank (new warehouse) in\u00a0<code>rightToLefti<\/code>\u00a0minutes.<\/p>\n<\/li>\n<li>\n<p>Put the box in the new warehouse and return to the bridge in\u00a0<code>putNewi<\/code>\u00a0minutes. Different workers can put their boxes simultaneously.<\/p>\n<\/li>\n<\/ul>\n<p>A worker\u00a0<code>i<\/code>\u00a0is less efficient than a worker\u00a0<code>j<\/code>\u00a0if either condition is met:<\/p>\n<ul>\n<li>\n<p><code>leftToRighti + rightToLefti > leftToRightj + rightToLeftj<\/code><\/p>\n<\/li>\n<li>\n<p><code>leftToRighti + rightToLefti == leftToRightj + rightToLeftj<\/code>\u00a0and\u00a0<code>i > j<\/code><\/p>\n<\/li>\n<\/ul>\n<p>The following rules regulate the movement of the workers through the bridge:<\/p>\n<ul>\n<li>\n<p>If a worker\u00a0<code>x<\/code>\u00a0reaches the bridge while another worker\u00a0<code>y<\/code>\u00a0is crossing the bridge,\u00a0<code>x<\/code>\u00a0waits at their side of the bridge.<\/p>\n<\/li>\n<li>\n<p>If the bridge is free, the worker waiting on the right side of the bridge gets to cross the bridge. If more than one worker is waiting on the right side, the one with the\u00a0<strong>lowest efficiency<\/strong>\u00a0crosses first.<\/p>\n<\/li>\n<li>\n<p>If the bridge is free and no worker is waiting on the right side, and at least one box remains at the old warehouse, the worker on the left side of the river gets to cross the bridge. If more than one worker is waiting on the left side, the one with the lowest efficiency crosses first.<\/p>\n<\/li>\n<\/ul>\n<p><strong><em><u>Return<\/u><\/em><\/strong><em>\u00a0the instance of time at which the last worker reaches the left bank of the river after all n boxes have been put in the new warehouse.<\/em><\/p>\n<p>Example 1:<\/p>\n<pre><code>Input: n = 1, k = 3, time = [[1,1,2,1],[1,1,3,1],[1,1,4,1]] Output: 6 Explanation:  From 0 to 1: worker 2 crosses the bridge from the left bank to the right bank. From 1 to 2: worker 2 picks up a box from the old warehouse. From 2 to 6: worker 2 crosses the bridge from the right bank to the left bank. From 6 to 7: worker 2 puts a box at the new warehouse. The whole process ends after 7 minutes. We return 6 because the problem asks for the instance of time at which the last worker reaches the left bank.<\/code><\/pre>\n<p>Example 2:<\/p>\n<pre><code>Input: n = 3, k = 2, time = [[1,9,1,8],[10,10,10,10]] Output: 50 Explanation:  From 0  to 10: worker 1 crosses the bridge from the left bank to the right bank. From 10 to 20: worker 1 picks up a box from the old warehouse. From 10 to 11: worker 0 crosses the bridge from the left bank to the right bank. From 11 to 20: worker 0 picks up a box from the old warehouse. From 20 to 30: worker 1 crosses the bridge from the right bank to the left bank. From 30 to 40: worker 1 puts a box at the new warehouse. From 30 to 31: worker 0 crosses the bridge from the right bank to the left bank. From 31 to 39: worker 0 puts a box at the new warehouse. From 39 to 40: worker 0 crosses the bridge from the left bank to the right bank. From 40 to 49: worker 0 picks up a box from the old warehouse. From 49 to 50: worker 0 crosses the bridge from the right bank to the left bank. From 50 to 58: worker 0 puts a box at the new warehouse. The whole process ends after 58 minutes. We return 50 because the problem asks for the instance of time at which the last worker reaches the left bank.<\/code><\/pre>\n<p><strong>Constraints<\/strong>:<br \/>1 &lt;= n, k &lt;= 10^4<br \/>time.length == k<br \/>time[i].length == 4<br \/>1 &lt;= leftToRighti, pickOldi, rightToLefti, putNewi &lt;= 1000<\/p>\n<h3>Approach<\/h3>\n<p>The main for-loop in the code handles the following steps:<\/p>\n<ol>\n<li>\n<p>Update the waiting list on the bridge.<\/p>\n<\/li>\n<li>\n<p>Pick a worker to pass the bridge based on the defined conditions.<\/p>\n<\/li>\n<li>\n<p>Advance the time.<\/p>\n<\/li>\n<li>\n<p>Update the count of remaining boxes that need to be moved.<\/p>\n<\/li>\n<\/ol>\n<p>Noteworthy points:<\/p>\n<ol>\n<li>\n<p>When there are enough workers on the right bank, workers on the left side should not pass the bridge.<\/p>\n<\/li>\n<li>\n<p>When there are no workers waiting to cross the bridge on either side, the time is moved to the next moment when a worker could potentially be waiting to cross.<\/p>\n<\/li>\n<\/ol>\n<h3>Code (Swift)<\/h3>\n<p>Overflow checks have been taken into consideration. The maximum time to move a box is at most 4 * 1000 (four steps to move the box, each taking 1000 time). With at most 1e4 boxes, the total time is at most 4e7, ensuring the solution is safe.<\/p>\n<pre><code class=\"swift\">class Solution {      func findCrossingTime(_ n: Int, _ k: Int, _ time: [[Int]]) -> Int {         var lBank = PriorityQueue&lt;Int>(comparator: { (a, b) -> Bool in             let ta = time[a]             let tb = time[b]             let ca = ta[0] + ta[2]             let cb = tb[0] + tb[2]             if ca == cb { return b &lt; a }  \/\/ larger index cross first             return cb &lt; ca  \/\/ larger cross time cross first         })         var rBank = PriorityQueue&lt;Int>(comparator: { (a, b) -> Bool in             let ta = time[a]             let tb = time[b]             let ca = ta[0] + ta[2]             let cb = tb[0] + tb[2]             if ca == cb { return b &lt; a }  \/\/ larger index cross first             return cb &lt; ca  \/\/ larger cross time cross first         })          \/\/ 0 -> time of the worker will be waiting to cross the bridge, 1 ->idx         var lWorker = PriorityQueue&lt;(Int, Int)>(comparator: { (a, b) -> Bool in a.0 &lt; b.0 })         var rWorker = PriorityQueue&lt;(Int, Int)>(comparator: { (a, b) -> Bool in a.0 &lt; b.0 })          \/\/ initially, all at left bank         for i in 0..&lt;k {             lBank.add(i)         }          var curTime = 0         var remainingBoxes = n         while remainingBoxes > 0 {             \/\/ process worker             while !lWorker.isEmpty &amp;&amp; lWorker.peek()!.0 &lt;= curTime {                 lBank.add(lWorker.poll()!.1)             }             while !rWorker.isEmpty &amp;&amp; rWorker.peek()!.0 &lt;= curTime {                 rBank.add(rWorker.poll()!.1)             }              var worker = -1             if !rBank.isEmpty {                 \/\/ right side can pass, a box will be put                 worker = rBank.poll()!                 let t = time[worker]                 lWorker.add((curTime + t[2] + t[3], worker))                 curTime += t[2]  \/\/ right to left                  remainingBoxes -= 1             } else if !lBank.isEmpty &amp;&amp; (remainingBoxes > rBank.size + rWorker.size) {                 \/\/ left side can pass                 \/\/ left side only pass when there are more boxes                 worker = lBank.poll()!                 let t = time[worker]                 rWorker.add((curTime + t[0] + t[1], worker))                 curTime += t[0]  \/\/ left to right             } else if remainingBoxes == rBank.size + rWorker.size {                 curTime = rWorker.peek()!.0             } else {                 \/\/ if still empty, advance time                 let nxt: Int                 if rWorker.isEmpty {                     nxt = lWorker.peek()!.0                 } else if lWorker.isEmpty {                     nxt = rWorker.peek()!.0                 } else {                     nxt = min(lWorker.peek()!.0, rWorker.peek()!.0)                 }                  curTime = nxt             }         }          return curTime     } }  \/\/ Wrapper class for PriorityQueue struct PriorityQueue&lt;Element> {     private var heap: [Element]     private let comparator: (Element, Element) -> Bool      init(comparator: @escaping (Element, Element) -> Bool) {         self.heap = []         self.comparator = comparator     }      var isEmpty: Bool {         return heap.isEmpty     }      var size: Int {         return heap.count     }      func peek() -> Element? {         return heap.first     }      mutating func add(_ element: Element) {         heap.append(element)         swim(heap.count - 1)     }      mutating func poll() -> Element? {         if heap.isEmpty { return nil }         if heap.count == 1 { return heap.removeFirst() }          heap.swapAt(0, heap.count - 1)         let element = heap.removeLast()         sink(0)          return element     }      private mutating func swim(_ index: Int) {         var childIndex = index         var parentIndex = (childIndex - 1) \/ 2          while childIndex > 0 &amp;&amp; comparator(heap[childIndex], heap[parentIndex]) {             heap.swapAt(childIndex, parentIndex)             childIndex = parentIndex             parentIndex = (childIndex - 1) \/ 2         }     }      private mutating func sink(_ index: Int) {         var parentIndex = index          while true {             let leftChildIndex = 2 * parentIndex + 1             let rightChildIndex = 2 * parentIndex + 2             var candidateIndex = parentIndex              if leftChildIndex &lt; heap.count &amp;&amp; comparator(heap[leftChildIndex], heap[candidateIndex])             {                 candidateIndex = leftChildIndex             }             if rightChildIndex &lt; heap.count                 &amp;&amp; comparator(heap[rightChildIndex], heap[candidateIndex])             {                 candidateIndex = rightChildIndex             }              if candidateIndex == parentIndex {                 return             }              heap.swapAt(parentIndex, candidateIndex)             parentIndex = candidateIndex         }     } }<\/code><\/pre>\n<p>Sources:\u00a0<a href=\"https:\/\/github.com\/sergeyleschev\/leetcode-swift\/blob\/main\/2501-3000\/2532.%20Time%20to%20Cross%20a%20Bridge.swift\" rel=\"noopener noreferrer nofollow\"><u>Github<\/u><\/a><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/752698\/\"> https:\/\/habr.com\/ru\/articles\/752698\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-351351","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/351351","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=351351"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/351351\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=351351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=351351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=351351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}