{"id":200,"date":"2018-08-19T20:01:33","date_gmt":"2018-08-19T12:01:33","guid":{"rendered":"https:\/\/www.ccagml.com\/?p=200"},"modified":"2018-11-27T17:30:11","modified_gmt":"2018-11-27T09:30:11","slug":"389-find-the-difference","status":"publish","type":"post","link":"https:\/\/www.ccagml.com\/?p=200","title":{"rendered":"389. Find the Difference"},"content":{"rendered":"<p>Given two strings\u00a0<b><i>s<\/i><\/b>\u00a0and\u00a0<b><i>t<\/i><\/b>\u00a0which consist of only lowercase letters.<\/p>\n<p>String\u00a0<b><i>t<\/i><\/b>\u00a0is generated by random shuffling string\u00a0<b><i>s<\/i><\/b>\u00a0and then add one more letter at a random position.<\/p>\n<p>Find the letter that was added in\u00a0<b><i>t<\/i><\/b>.<\/p>\n<p><b>Example:<\/b><\/p>\n<pre>Input:\r\ns = \"abcd\"\r\nt = \"abcde\"\r\n\r\nOutput:\r\ne\r\n\r\nExplanation:\r\n'e' is the letter that was added.<\/pre>\n<p><strong>Python<\/strong><\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\"> \r\nclass Solution(object):\r\n    def findTheDifference(self, s, t):\r\n        &quot;&quot;&quot;\r\n        :type s: str\r\n        :type t: str\r\n        :rtype: str\r\n        &quot;&quot;&quot;\r\n        result = []\r\n        for ti in t:\r\n            result.append(ti)\r\n        for si in s:\r\n            result.remove(si)\r\n        return &quot;&quot;.join(result)\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Given two strings\u00a0s\u00a0and\u00a0t\u00a0which consist of only lowerca<a href=\"https:\/\/www.ccagml.com\/?p=200\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">389. Find the Difference<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[29,20],"tags":[],"_links":{"self":[{"href":"https:\/\/www.ccagml.com\/index.php?rest_route=\/wp\/v2\/posts\/200"}],"collection":[{"href":"https:\/\/www.ccagml.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ccagml.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ccagml.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ccagml.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=200"}],"version-history":[{"count":1,"href":"https:\/\/www.ccagml.com\/index.php?rest_route=\/wp\/v2\/posts\/200\/revisions"}],"predecessor-version":[{"id":201,"href":"https:\/\/www.ccagml.com\/index.php?rest_route=\/wp\/v2\/posts\/200\/revisions\/201"}],"wp:attachment":[{"href":"https:\/\/www.ccagml.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ccagml.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=200"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ccagml.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}