{"action":"created","comment":{"url":"https://api.github.com/repos/janetian/leetcode/pulls/comments/92927342","pull_request_review_id":13451541,"id":92927342,"diff_hunk":"@@ -0,0 +1,62 @@\n+110. Balanced Binary Tree\n+\n+Given a binary tree, determine if it is height-balanced.\n+\n+For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never differ by more than 1. \n+\n+\n+Answer:\n+/**\n+ * Definition for a binary tree node.\n+ * struct TreeNode {\n+ *     int val;\n+ *     TreeNode *left;\n+ *     TreeNode *right;\n+ *     TreeNode(int x) : val(x), left(NULL), right(NULL) {}\n+ * };\n+ */\n+class Solution {\n+public:\n+\tint maxDepth(TreeNode* root)\n+\t{\n+\t\tif (root == NULL)\n+\t\t{\n+\t\t\treturn 0;\n+\t\t}\n+\t\tint left, right;\n+\t\tif (root->left == NULL)\n+\t\t{\n+\t\t\tleft = 1;\n+\t\t}\n+\t\telse\n+\t\t{\n+\t\t\tleft = 1 + maxDepth(root->left);\n+\t\t}\n+\t\tif (root->right == NULL)\n+\t\t{\n+\t\t\tright = 1;\n+\t\t}\n+\t\telse\n+\t\t{\n+\t\t\tright = 1 + maxDepth(root->right);\n+\t\t}\n+\t\treturn max(left, right);\n+\t}\n+\tbool isBalanced(TreeNode* root)","path":"Question110.txt","position":45,"original_position":45,"commit_id":"e9e5c80dc6af858bdb825a325443a700169eec5d","original_commit_id":"e9e5c80dc6af858bdb825a325443a700169eec5d","user":{"login":"janetian","id":14239746,"avatar_url":"https://avatars.githubusercontent.com/u/14239746?v=3","gravatar_id":"","url":"https://api.github.com/users/janetian","html_url":"https://github.com/janetian","followers_url":"https://api.github.com/users/janetian/followers","following_url":"https://api.github.com/users/janetian/following{/other_user}","gists_url":"https://api.github.com/users/janetian/gists{/gist_id}","starred_url":"https://api.github.com/users/janetian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janetian/subscriptions","organizations_url":"https://api.github.com/users/janetian/orgs","repos_url":"https://api.github.com/users/janetian/repos","events_url":"https://api.github.com/users/janetian/events{/privacy}","received_events_url":"https://api.github.com/users/janetian/received_events","type":"User","site_admin":false},"body":"(test only) I think it is fine.","created_at":"2016-12-17T19:17:12Z","updated_at":"2016-12-17T19:17:12Z","html_url":"https://github.com/janetian/leetcode/pull/3#discussion_r92927342","pull_request_url":"https://api.github.com/repos/janetian/leetcode/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/janetian/leetcode/pulls/comments/92927342"},"html":{"href":"https://github.com/janetian/leetcode/pull/3#discussion_r92927342"},"pull_request":{"href":"https://api.github.com/repos/janetian/leetcode/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/janetian/leetcode/pulls/3","id":98452761,"html_url":"https://github.com/janetian/leetcode/pull/3","diff_url":"https://github.com/janetian/leetcode/pull/3.diff","patch_url":"https://github.com/janetian/leetcode/pull/3.patch","issue_url":"https://api.github.com/repos/janetian/leetcode/issues/3","number":3,"state":"open","locked":false,"title":"Working","user":{"login":"janetian","id":14239746,"avatar_url":"https://avatars.githubusercontent.com/u/14239746?v=3","gravatar_id":"","url":"https://api.github.com/users/janetian","html_url":"https://github.com/janetian","followers_url":"https://api.github.com/users/janetian/followers","following_url":"https://api.github.com/users/janetian/following{/other_user}","gists_url":"https://api.github.com/users/janetian/gists{/gist_id}","starred_url":"https://api.github.com/users/janetian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janetian/subscriptions","organizations_url":"https://api.github.com/users/janetian/orgs","repos_url":"https://api.github.com/users/janetian/repos","events_url":"https://api.github.com/users/janetian/events{/privacy}","received_events_url":"https://api.github.com/users/janetian/received_events","type":"User","site_admin":false},"body":"More questions added","created_at":"2016-12-17T19:13:26Z","updated_at":"2016-12-17T19:17:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f438467e361a32ec8abab3625e971d826c6e1cb3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/janetian/leetcode/pulls/3/commits","review_comments_url":"https://api.github.com/repos/janetian/leetcode/pulls/3/comments","review_comment_url":"https://api.github.com/repos/janetian/leetcode/pulls/comments{/number}","comments_url":"https://api.github.com/repos/janetian/leetcode/issues/3/comments","statuses_url":"https://api.github.com/repos/janetian/leetcode/statuses/e9e5c80dc6af858bdb825a325443a700169eec5d","head":{"label":"janetian:working","ref":"working","sha":"e9e5c80dc6af858bdb825a325443a700169eec5d","user":{"login":"janetian","id":14239746,"avatar_url":"https://avatars.githubusercontent.com/u/14239746?v=3","gravatar_id":"","url":"https://api.github.com/users/janetian","html_url":"https://github.com/janetian","followers_url":"https://api.github.com/users/janetian/followers","following_url":"https://api.github.com/users/janetian/following{/other_user}","gists_url":"https://api.github.com/users/janetian/gists{/gist_id}","starred_url":"https://api.github.com/users/janetian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janetian/subscriptions","organizations_url":"https://api.github.com/users/janetian/orgs","repos_url":"https://api.github.com/users/janetian/repos","events_url":"https://api.github.com/users/janetian/events{/privacy}","received_events_url":"https://api.github.com/users/janetian/received_events","type":"User","site_admin":false},"repo":{"id":71417494,"name":"leetcode","full_name":"janetian/leetcode","owner":{"login":"janetian","id":14239746,"avatar_url":"https://avatars.githubusercontent.com/u/14239746?v=3","gravatar_id":"","url":"https://api.github.com/users/janetian","html_url":"https://github.com/janetian","followers_url":"https://api.github.com/users/janetian/followers","following_url":"https://api.github.com/users/janetian/following{/other_user}","gists_url":"https://api.github.com/users/janetian/gists{/gist_id}","starred_url":"https://api.github.com/users/janetian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janetian/subscriptions","organizations_url":"https://api.github.com/users/janetian/orgs","repos_url":"https://api.github.com/users/janetian/repos","events_url":"https://api.github.com/users/janetian/events{/privacy}","received_events_url":"https://api.github.com/users/janetian/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/janetian/leetcode","description":null,"fork":false,"url":"https://api.github.com/repos/janetian/leetcode","forks_url":"https://api.github.com/repos/janetian/leetcode/forks","keys_url":"https://api.github.com/repos/janetian/leetcode/keys{/key_id}","collaborators_url":"https://api.github.com/repos/janetian/leetcode/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/janetian/leetcode/teams","hooks_url":"https://api.github.com/repos/janetian/leetcode/hooks","issue_events_url":"https://api.github.com/repos/janetian/leetcode/issues/events{/number}","events_url":"https://api.github.com/repos/janetian/leetcode/events","assignees_url":"https://api.github.com/repos/janetian/leetcode/assignees{/user}","branches_url":"https://api.github.com/repos/janetian/leetcode/branches{/branch}","tags_url":"https://api.github.com/repos/janetian/leetcode/tags","blobs_url":"https://api.github.com/repos/janetian/leetcode/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/janetian/leetcode/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/janetian/leetcode/git/refs{/sha}","trees_url":"https://api.github.com/repos/janetian/leetcode/git/trees{/sha}","statuses_url":"https://api.github.com/repos/janetian/leetcode/statuses/{sha}","languages_url":"https://api.github.com/repos/janetian/leetcode/languages","stargazers_url":"https://api.github.com/repos/janetian/leetcode/stargazers","contributors_url":"https://api.github.com/repos/janetian/leetcode/contributors","subscribers_url":"https://api.github.com/repos/janetian/leetcode/subscribers","subscription_url":"https://api.github.com/repos/janetian/leetcode/subscription","commits_url":"https://api.github.com/repos/janetian/leetcode/commits{/sha}","git_commits_url":"https://api.github.com/repos/janetian/leetcode/git/commits{/sha}","comments_url":"https://api.github.com/repos/janetian/leetcode/comments{/number}","issue_comment_url":"https://api.github.com/repos/janetian/leetcode/issues/comments{/number}","contents_url":"https://api.github.com/repos/janetian/leetcode/contents/{+path}","compare_url":"https://api.github.com/repos/janetian/leetcode/compare/{base}...{head}","merges_url":"https://api.github.com/repos/janetian/leetcode/merges","archive_url":"https://api.github.com/repos/janetian/leetcode/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/janetian/leetcode/downloads","issues_url":"https://api.github.com/repos/janetian/leetcode/issues{/number}","pulls_url":"https://api.github.com/repos/janetian/leetcode/pulls{/number}","milestones_url":"https://api.github.com/repos/janetian/leetcode/milestones{/number}","notifications_url":"https://api.github.com/repos/janetian/leetcode/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/janetian/leetcode/labels{/name}","releases_url":"https://api.github.com/repos/janetian/leetcode/releases{/id}","deployments_url":"https://api.github.com/repos/janetian/leetcode/deployments","created_at":"2016-10-20T02:21:52Z","updated_at":"2016-10-20T02:21:52Z","pushed_at":"2016-12-17T19:13:26Z","git_url":"git://github.com/janetian/leetcode.git","ssh_url":"git@github.com:janetian/leetcode.git","clone_url":"https://github.com/janetian/leetcode.git","svn_url":"https://github.com/janetian/leetcode","homepage":null,"size":14,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"janetian:master","ref":"master","sha":"5d1ea5c40075ae2a549fbcca896853dae4065dc7","user":{"login":"janetian","id":14239746,"avatar_url":"https://avatars.githubusercontent.com/u/14239746?v=3","gravatar_id":"","url":"https://api.github.com/users/janetian","html_url":"https://github.com/janetian","followers_url":"https://api.github.com/users/janetian/followers","following_url":"https://api.github.com/users/janetian/following{/other_user}","gists_url":"https://api.github.com/users/janetian/gists{/gist_id}","starred_url":"https://api.github.com/users/janetian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janetian/subscriptions","organizations_url":"https://api.github.com/users/janetian/orgs","repos_url":"https://api.github.com/users/janetian/repos","events_url":"https://api.github.com/users/janetian/events{/privacy}","received_events_url":"https://api.github.com/users/janetian/received_events","type":"User","site_admin":false},"repo":{"id":71417494,"name":"leetcode","full_name":"janetian/leetcode","owner":{"login":"janetian","id":14239746,"avatar_url":"https://avatars.githubusercontent.com/u/14239746?v=3","gravatar_id":"","url":"https://api.github.com/users/janetian","html_url":"https://github.com/janetian","followers_url":"https://api.github.com/users/janetian/followers","following_url":"https://api.github.com/users/janetian/following{/other_user}","gists_url":"https://api.github.com/users/janetian/gists{/gist_id}","starred_url":"https://api.github.com/users/janetian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janetian/subscriptions","organizations_url":"https://api.github.com/users/janetian/orgs","repos_url":"https://api.github.com/users/janetian/repos","events_url":"https://api.github.com/users/janetian/events{/privacy}","received_events_url":"https://api.github.com/users/janetian/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/janetian/leetcode","description":null,"fork":false,"url":"https://api.github.com/repos/janetian/leetcode","forks_url":"https://api.github.com/repos/janetian/leetcode/forks","keys_url":"https://api.github.com/repos/janetian/leetcode/keys{/key_id}","collaborators_url":"https://api.github.com/repos/janetian/leetcode/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/janetian/leetcode/teams","hooks_url":"https://api.github.com/repos/janetian/leetcode/hooks","issue_events_url":"https://api.github.com/repos/janetian/leetcode/issues/events{/number}","events_url":"https://api.github.com/repos/janetian/leetcode/events","assignees_url":"https://api.github.com/repos/janetian/leetcode/assignees{/user}","branches_url":"https://api.github.com/repos/janetian/leetcode/branches{/branch}","tags_url":"https://api.github.com/repos/janetian/leetcode/tags","blobs_url":"https://api.github.com/repos/janetian/leetcode/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/janetian/leetcode/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/janetian/leetcode/git/refs{/sha}","trees_url":"https://api.github.com/repos/janetian/leetcode/git/trees{/sha}","statuses_url":"https://api.github.com/repos/janetian/leetcode/statuses/{sha}","languages_url":"https://api.github.com/repos/janetian/leetcode/languages","stargazers_url":"https://api.github.com/repos/janetian/leetcode/stargazers","contributors_url":"https://api.github.com/repos/janetian/leetcode/contributors","subscribers_url":"https://api.github.com/repos/janetian/leetcode/subscribers","subscription_url":"https://api.github.com/repos/janetian/leetcode/subscription","commits_url":"https://api.github.com/repos/janetian/leetcode/commits{/sha}","git_commits_url":"https://api.github.com/repos/janetian/leetcode/git/commits{/sha}","comments_url":"https://api.github.com/repos/janetian/leetcode/comments{/number}","issue_comment_url":"https://api.github.com/repos/janetian/leetcode/issues/comments{/number}","contents_url":"https://api.github.com/repos/janetian/leetcode/contents/{+path}","compare_url":"https://api.github.com/repos/janetian/leetcode/compare/{base}...{head}","merges_url":"https://api.github.com/repos/janetian/leetcode/merges","archive_url":"https://api.github.com/repos/janetian/leetcode/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/janetian/leetcode/downloads","issues_url":"https://api.github.com/repos/janetian/leetcode/issues{/number}","pulls_url":"https://api.github.com/repos/janetian/leetcode/pulls{/number}","milestones_url":"https://api.github.com/repos/janetian/leetcode/milestones{/number}","notifications_url":"https://api.github.com/repos/janetian/leetcode/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/janetian/leetcode/labels{/name}","releases_url":"https://api.github.com/repos/janetian/leetcode/releases{/id}","deployments_url":"https://api.github.com/repos/janetian/leetcode/deployments","created_at":"2016-10-20T02:21:52Z","updated_at":"2016-10-20T02:21:52Z","pushed_at":"2016-12-17T19:13:26Z","git_url":"git://github.com/janetian/leetcode.git","ssh_url":"git@github.com:janetian/leetcode.git","clone_url":"https://github.com/janetian/leetcode.git","svn_url":"https://github.com/janetian/leetcode","homepage":null,"size":14,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/janetian/leetcode/pulls/3"},"html":{"href":"https://github.com/janetian/leetcode/pull/3"},"issue":{"href":"https://api.github.com/repos/janetian/leetcode/issues/3"},"comments":{"href":"https://api.github.com/repos/janetian/leetcode/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/janetian/leetcode/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/janetian/leetcode/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/janetian/leetcode/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/janetian/leetcode/statuses/e9e5c80dc6af858bdb825a325443a700169eec5d"}}}}
{"actor":{"display_login":"janetian"}}