{"action":"opened","issue":{"url":"https://api.github.com/repos/ZhaoChunLi/Leetcode/issues/6","repository_url":"https://api.github.com/repos/ZhaoChunLi/Leetcode","labels_url":"https://api.github.com/repos/ZhaoChunLi/Leetcode/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/ZhaoChunLi/Leetcode/issues/6/comments","events_url":"https://api.github.com/repos/ZhaoChunLi/Leetcode/issues/6/events","html_url":"https://github.com/ZhaoChunLi/Leetcode/issues/6","id":189278078,"number":6,"title":"Longest Palindrome2","user":{"login":"ZhaoChunLi","id":17823589,"avatar_url":"https://avatars.githubusercontent.com/u/17823589?v=3","gravatar_id":"","url":"https://api.github.com/users/ZhaoChunLi","html_url":"https://github.com/ZhaoChunLi","followers_url":"https://api.github.com/users/ZhaoChunLi/followers","following_url":"https://api.github.com/users/ZhaoChunLi/following{/other_user}","gists_url":"https://api.github.com/users/ZhaoChunLi/gists{/gist_id}","starred_url":"https://api.github.com/users/ZhaoChunLi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZhaoChunLi/subscriptions","organizations_url":"https://api.github.com/users/ZhaoChunLi/orgs","repos_url":"https://api.github.com/users/ZhaoChunLi/repos","events_url":"https://api.github.com/users/ZhaoChunLi/events{/privacy}","received_events_url":"https://api.github.com/users/ZhaoChunLi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-15T01:52:03Z","updated_at":"2016-11-15T01:52:03Z","closed_at":null,"body":"public class Solution {\r\n    public int longestPalindrome(String s) {\r\n        if(s==null){\r\n            return 0;\r\n        }\r\n        if(s.length()==1){\r\n            return 1;\r\n        }\r\n        ArrayList<Character> list=new ArrayList<Character>();\r\n        for(int i=0;i<s.length();i++){\r\n            char c=s.charAt(i);\r\n            if(!list.contains(c)){\r\n                list.add(c);\r\n            }\r\n            else{\r\n                list.remove(list.indexOf(c));\r\n            }\r\n        }\r\n        int len=list.size();\r\n        if(len>0){\r\n            return s.length()-len+1;\r\n        }\r\n        else{\r\n            return s.length()-len;\r\n        }\r\n        \r\n    }\r\n}"}}
{"actor":{"display_login":"ZhaoChunLi"}}