{"id":318,"date":"2013-07-13T07:30:28","date_gmt":"2013-07-13T11:30:28","guid":{"rendered":"http:\/\/www.ferociouscoder.com\/blog\/?p=318"},"modified":"2013-07-13T07:30:28","modified_gmt":"2013-07-13T11:30:28","slug":"uva-162-beggar-my-neighbour","status":"publish","type":"post","link":"https:\/\/www.ferociouscoder.com\/blog\/archives\/uva-162-beggar-my-neighbour-318.html","title":{"rendered":"UVA 162 &#8211; Beggar My Neighbour"},"content":{"rendered":"<p>This was a pain to debug but I finally got it right. There&#8217;s a little bit of trickery with outputting the result as well so watch out for that!<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nimport java.io.PrintWriter;\r\nimport java.util.Collections;\r\nimport java.util.LinkedList;\r\nimport java.util.Scanner;\r\nimport java.util.StringTokenizer;\r\n\r\n\/**\r\n * \r\n * @author Sanchit M. Bhatnagar\r\n * @see http:\/\/uhunt.felix-halim.net\/id\/74004\r\n * \r\n *\/\r\npublic class P162 {\r\n\r\n  public static void main(String&#x5B;] args) {\r\n    Scanner sc = new Scanner(System.in);\r\n    PrintWriter out = new PrintWriter(System.out);\r\n\r\n    while (sc.hasNextLine()) {\r\n      String line = sc.nextLine().trim();\r\n      while (line.equals(&quot;&quot;))\r\n        line = sc.nextLine();\r\n      if (line.equals(&quot;#&quot;))\r\n        break;\r\n\r\n      gameOver = false;\r\n      Player&#x5B;] players = new Player&#x5B;2];\r\n      for (int i = 0; i &lt; players.length; i++) {\r\n        players&#x5B;i] = new Player();\r\n      }\r\n      Card&#x5B;] deck = new Card&#x5B;52];\r\n      StringTokenizer st = new StringTokenizer(line);\r\n      for (int i = 0; i &lt; 13; i++) {\r\n        deck&#x5B;i] = new Card(st.nextToken());\r\n      }\r\n      for (int i = 13; i &lt; 52; i++) {\r\n        deck&#x5B;i] = new Card(sc.next());\r\n      }\r\n\r\n      for (int j = 0; j &lt; players.length; j++) {\r\n        for (int i = 0; i &lt; 26; i++) {\r\n          players&#x5B;j].deck.add(deck&#x5B;i * 2 + j]);\r\n        }\r\n        Collections.reverse(players&#x5B;j].deck);\r\n      }\r\n\r\n      \/\/ players&#x5B;0] = non-dealer\r\n      \/\/ players&#x5B;1] = dealer\r\n\r\n      int idx = 0;\r\n      LinkedList&lt;Card&gt; stack = new LinkedList&lt;&gt;();\r\n      while ((players&#x5B;0].deck.size() &gt; 0 || players&#x5B;1].deck.size() &gt; 0) &amp;&amp; !gameOver) {\r\n        Card played = players&#x5B;idx].deck.poll();\r\n        if (played == null)\r\n          break;\r\n        stack.add(played);\r\n        if (played.isFaceCard()) {\r\n          idx = doThing(stack, players, idx);\r\n        }\r\n        idx = 1 - idx;\r\n      }\r\n      if (players&#x5B;0].deck.isEmpty()) {\r\n        out.println(&quot;1 &quot; + String.format(&quot;%2d&quot;, players&#x5B;1].deck.size()));\r\n      } else {\r\n        out.println(&quot;2 &quot; + String.format(&quot;%2d&quot;, players&#x5B;0].deck.size()));\r\n      }\r\n\r\n    }\r\n    out.close();\r\n    sc.close();\r\n  }\r\n\r\n  private static boolean gameOver = false;\r\n\r\n  private static int doThing(LinkedList&lt;Card&gt; stack, Player&#x5B;] players, int idx) {\r\n    boolean good = true;\r\n    idx = 1 - idx;\r\n    int val = getGameCardVal(stack.peekLast());\r\n    for (int i = 0; i &lt; val; i++) {\r\n      Card played = players&#x5B;idx].deck.poll();\r\n      if (played == null) {\r\n        gameOver = true;\r\n        good = false;\r\n        break;\r\n      } else {\r\n        stack.add(played);\r\n        if (played.isFaceCard()) {\r\n          return doThing(stack, players, idx);\r\n        }\r\n      }\r\n    }\r\n    if (good)\r\n      while (!stack.isEmpty()) {\r\n        players&#x5B;1 - idx].deck.add(stack.poll());\r\n      }\r\n    return idx;\r\n  }\r\n\r\n  private static int getGameCardVal(Card c) {\r\n    switch (c.card.charAt(1)) {\r\n      case 'A':\r\n        return 4;\r\n      case 'K':\r\n        return 3;\r\n      case 'Q':\r\n        return 2;\r\n      case 'J':\r\n        return 1;\r\n    }\r\n    return 0;\r\n  }\r\n\r\n  private static class Card {\r\n    String card;\r\n\r\n    public Card(String card) {\r\n      int test1 = getSuitIdx(card.charAt(0));\r\n      if (test1 == -1)\r\n        return;\r\n      int test2 = getNumIdx(card.charAt(1));\r\n      if (test2 == -1)\r\n        return;\r\n      this.card = card;\r\n    }\r\n\r\n    public boolean isFaceCard() {\r\n      int val = getCardValue();\r\n      return (val == 1 || val == 11 || val == 12 || val == 13);\r\n    }\r\n\r\n    public int getCardValue() {\r\n      return getNumIdx(card.charAt(1));\r\n    }\r\n\r\n    private int getSuitIdx(char suit) {\r\n      switch (suit) {\r\n        case 'H':\r\n          return 0;\r\n        case 'S':\r\n          return 1;\r\n        case 'D':\r\n          return 2;\r\n        case 'C':\r\n          return 3;\r\n      }\r\n      return -1;\r\n    }\r\n\r\n    private int getNumIdx(char num) {\r\n      switch (num) {\r\n        case 'A':\r\n          return 1;\r\n        case 'T':\r\n          return 10;\r\n        case 'J':\r\n          return 11;\r\n        case 'Q':\r\n          return 12;\r\n        case 'K':\r\n          return 13;\r\n        default:\r\n          try {\r\n            int val = Integer.parseInt(num + &quot;&quot;);\r\n            if (val &gt; 1 &amp;&amp; val &lt; 10)\r\n              return val;\r\n            return -1;\r\n          } catch (Exception e) {\r\n            return -1;\r\n          }\r\n      }\r\n    }\r\n\r\n    @Override\r\n    public String toString() {\r\n      return this.card;\r\n    }\r\n\r\n  }\r\n\r\n  private static class Player {\r\n    private LinkedList&lt;Card&gt; deck;\r\n\r\n    public Player() {\r\n      deck = new LinkedList&lt;&gt;();\r\n    }\r\n\r\n    @Override\r\n    public String toString() {\r\n      return this.deck.toString();\r\n    }\r\n  }\r\n\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This was a pain to debug but I finally got it right. There&#8217;s a little bit of trickery with outputting the result as well so watch out for that! import java.io.PrintWriter; import java.util.Collections; import java.util.LinkedList; import java.util.Scanner; import java.util.StringTokenizer; \/** * * @author Sanchit M. Bhatnagar * @see http:\/\/uhunt.felix-halim.net\/id\/74004 * *\/ public class P162 { &hellip; <a href=\"https:\/\/www.ferociouscoder.com\/blog\/archives\/uva-162-beggar-my-neighbour-318.html\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">UVA 162 &#8211; Beggar My Neighbour<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[14,18,19,17],"tags":[21,20,22],"class_list":["post-318","post","type-post","status-publish","format-standard","hentry","category-algorithms","category-competitive-programming-3","category-java","category-uva-online-judge","tag-competitive-programming-3-2","tag-java-2","tag-uva-online-judge-2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>UVA 162 - Beggar My Neighbour - Ferocious Coder<\/title>\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.ferociouscoder.com\/blog\/archives\/uva-162-beggar-my-neighbour-318.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"UVA 162 - Beggar My Neighbour - Ferocious Coder\" \/>\n<meta property=\"og:description\" content=\"This was a pain to debug but I finally got it right. There&#8217;s a little bit of trickery with outputting the result as well so watch out for that! import java.io.PrintWriter; import java.util.Collections; import java.util.LinkedList; import java.util.Scanner; import java.util.StringTokenizer; \/** * * @author Sanchit M. Bhatnagar * @see http:\/\/uhunt.felix-halim.net\/id\/74004 * *\/ public class P162 { &hellip; Continue reading UVA 162 &#8211; Beggar My Neighbour &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.ferociouscoder.com\/blog\/archives\/uva-162-beggar-my-neighbour-318.html\" \/>\n<meta property=\"og:site_name\" content=\"Ferocious Coder\" \/>\n<meta property=\"article:published_time\" content=\"2013-07-13T11:30:28+00:00\" \/>\n<meta name=\"author\" content=\"Rawrosaur\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rawrosaur\" \/>\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:\\\/\\\/www.ferociouscoder.com\\\/blog\\\/archives\\\/uva-162-beggar-my-neighbour-318.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.ferociouscoder.com\\\/blog\\\/archives\\\/uva-162-beggar-my-neighbour-318.html\"},\"author\":{\"name\":\"Rawrosaur\",\"@id\":\"https:\\\/\\\/www.ferociouscoder.com\\\/blog\\\/#\\\/schema\\\/person\\\/1fb5cbee546cffd619a7b301e3dc447a\"},\"headline\":\"UVA 162 &#8211; Beggar My Neighbour\",\"datePublished\":\"2013-07-13T11:30:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.ferociouscoder.com\\\/blog\\\/archives\\\/uva-162-beggar-my-neighbour-318.html\"},\"wordCount\":519,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.ferociouscoder.com\\\/blog\\\/#\\\/schema\\\/person\\\/1fb5cbee546cffd619a7b301e3dc447a\"},\"keywords\":[\"competitive programming 3\",\"java\",\"uva online judge\"],\"articleSection\":[\"Algorithms\",\"Competitive Programming 3\",\"Java\",\"UVA Online Judge\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.ferociouscoder.com\\\/blog\\\/archives\\\/uva-162-beggar-my-neighbour-318.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.ferociouscoder.com\\\/blog\\\/archives\\\/uva-162-beggar-my-neighbour-318.html\",\"url\":\"https:\\\/\\\/www.ferociouscoder.com\\\/blog\\\/archives\\\/uva-162-beggar-my-neighbour-318.html\",\"name\":\"UVA 162 - Beggar My Neighbour - Ferocious Coder\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.ferociouscoder.com\\\/blog\\\/#website\"},\"datePublished\":\"2013-07-13T11:30:28+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.ferociouscoder.com\\\/blog\\\/archives\\\/uva-162-beggar-my-neighbour-318.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.ferociouscoder.com\\\/blog\\\/archives\\\/uva-162-beggar-my-neighbour-318.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.ferociouscoder.com\\\/blog\\\/archives\\\/uva-162-beggar-my-neighbour-318.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.ferociouscoder.com\\\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"UVA 162 &#8211; Beggar My Neighbour\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.ferociouscoder.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.ferociouscoder.com\\\/blog\\\/\",\"name\":\"Ferocious Coder\",\"description\":\"RAWR!\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.ferociouscoder.com\\\/blog\\\/#\\\/schema\\\/person\\\/1fb5cbee546cffd619a7b301e3dc447a\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.ferociouscoder.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.ferociouscoder.com\\\/blog\\\/#\\\/schema\\\/person\\\/1fb5cbee546cffd619a7b301e3dc447a\",\"name\":\"Rawrosaur\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1372156bd3b16de375c8727c2c617467bf6ff38f1679a7912f48286349c17e96?s=96&d=retro&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1372156bd3b16de375c8727c2c617467bf6ff38f1679a7912f48286349c17e96?s=96&d=retro&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1372156bd3b16de375c8727c2c617467bf6ff38f1679a7912f48286349c17e96?s=96&d=retro&r=pg\",\"caption\":\"Rawrosaur\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1372156bd3b16de375c8727c2c617467bf6ff38f1679a7912f48286349c17e96?s=96&d=retro&r=pg\"},\"sameAs\":[\"http:\\\/\\\/www.ferociouscoder.com\\\/\"],\"url\":\"https:\\\/\\\/www.ferociouscoder.com\\\/blog\\\/archives\\\/author\\\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"UVA 162 - Beggar My Neighbour - Ferocious Coder","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.ferociouscoder.com\/blog\/archives\/uva-162-beggar-my-neighbour-318.html","og_locale":"en_US","og_type":"article","og_title":"UVA 162 - Beggar My Neighbour - Ferocious Coder","og_description":"This was a pain to debug but I finally got it right. There&#8217;s a little bit of trickery with outputting the result as well so watch out for that! import java.io.PrintWriter; import java.util.Collections; import java.util.LinkedList; import java.util.Scanner; import java.util.StringTokenizer; \/** * * @author Sanchit M. Bhatnagar * @see http:\/\/uhunt.felix-halim.net\/id\/74004 * *\/ public class P162 { &hellip; Continue reading UVA 162 &#8211; Beggar My Neighbour &rarr;","og_url":"https:\/\/www.ferociouscoder.com\/blog\/archives\/uva-162-beggar-my-neighbour-318.html","og_site_name":"Ferocious Coder","article_published_time":"2013-07-13T11:30:28+00:00","author":"Rawrosaur","twitter_misc":{"Written by":"Rawrosaur","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.ferociouscoder.com\/blog\/archives\/uva-162-beggar-my-neighbour-318.html#article","isPartOf":{"@id":"https:\/\/www.ferociouscoder.com\/blog\/archives\/uva-162-beggar-my-neighbour-318.html"},"author":{"name":"Rawrosaur","@id":"https:\/\/www.ferociouscoder.com\/blog\/#\/schema\/person\/1fb5cbee546cffd619a7b301e3dc447a"},"headline":"UVA 162 &#8211; Beggar My Neighbour","datePublished":"2013-07-13T11:30:28+00:00","mainEntityOfPage":{"@id":"https:\/\/www.ferociouscoder.com\/blog\/archives\/uva-162-beggar-my-neighbour-318.html"},"wordCount":519,"commentCount":0,"publisher":{"@id":"https:\/\/www.ferociouscoder.com\/blog\/#\/schema\/person\/1fb5cbee546cffd619a7b301e3dc447a"},"keywords":["competitive programming 3","java","uva online judge"],"articleSection":["Algorithms","Competitive Programming 3","Java","UVA Online Judge"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.ferociouscoder.com\/blog\/archives\/uva-162-beggar-my-neighbour-318.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.ferociouscoder.com\/blog\/archives\/uva-162-beggar-my-neighbour-318.html","url":"https:\/\/www.ferociouscoder.com\/blog\/archives\/uva-162-beggar-my-neighbour-318.html","name":"UVA 162 - Beggar My Neighbour - Ferocious Coder","isPartOf":{"@id":"https:\/\/www.ferociouscoder.com\/blog\/#website"},"datePublished":"2013-07-13T11:30:28+00:00","breadcrumb":{"@id":"https:\/\/www.ferociouscoder.com\/blog\/archives\/uva-162-beggar-my-neighbour-318.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.ferociouscoder.com\/blog\/archives\/uva-162-beggar-my-neighbour-318.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.ferociouscoder.com\/blog\/archives\/uva-162-beggar-my-neighbour-318.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.ferociouscoder.com\/blog"},{"@type":"ListItem","position":2,"name":"UVA 162 &#8211; Beggar My Neighbour"}]},{"@type":"WebSite","@id":"https:\/\/www.ferociouscoder.com\/blog\/#website","url":"https:\/\/www.ferociouscoder.com\/blog\/","name":"Ferocious Coder","description":"RAWR!","publisher":{"@id":"https:\/\/www.ferociouscoder.com\/blog\/#\/schema\/person\/1fb5cbee546cffd619a7b301e3dc447a"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.ferociouscoder.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.ferociouscoder.com\/blog\/#\/schema\/person\/1fb5cbee546cffd619a7b301e3dc447a","name":"Rawrosaur","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1372156bd3b16de375c8727c2c617467bf6ff38f1679a7912f48286349c17e96?s=96&d=retro&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/1372156bd3b16de375c8727c2c617467bf6ff38f1679a7912f48286349c17e96?s=96&d=retro&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1372156bd3b16de375c8727c2c617467bf6ff38f1679a7912f48286349c17e96?s=96&d=retro&r=pg","caption":"Rawrosaur"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/1372156bd3b16de375c8727c2c617467bf6ff38f1679a7912f48286349c17e96?s=96&d=retro&r=pg"},"sameAs":["http:\/\/www.ferociouscoder.com\/"],"url":"https:\/\/www.ferociouscoder.com\/blog\/archives\/author\/admin"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p1mYMV-58","jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ferociouscoder.com\/blog\/wp-json\/wp\/v2\/posts\/318","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ferociouscoder.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ferociouscoder.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ferociouscoder.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ferociouscoder.com\/blog\/wp-json\/wp\/v2\/comments?post=318"}],"version-history":[{"count":1,"href":"https:\/\/www.ferociouscoder.com\/blog\/wp-json\/wp\/v2\/posts\/318\/revisions"}],"predecessor-version":[{"id":319,"href":"https:\/\/www.ferociouscoder.com\/blog\/wp-json\/wp\/v2\/posts\/318\/revisions\/319"}],"wp:attachment":[{"href":"https:\/\/www.ferociouscoder.com\/blog\/wp-json\/wp\/v2\/media?parent=318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ferociouscoder.com\/blog\/wp-json\/wp\/v2\/categories?post=318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ferociouscoder.com\/blog\/wp-json\/wp\/v2\/tags?post=318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}