摘要: 1 int Bible[30]; 2 3 bool cmp(char a,char b) 4 { 5 // printf("%d %d\n",a,b); 6 return Bible[a-'a'] >= Bible[b-'a'] ? 0 : 1;//-97 7 } 8 9 class Solution 10 { 11 public: 12 ... 阅读全文
posted @ 2018-11-13 18:47 Asurudo 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution 2 { 3 public: 4 int minMoves2(vector& nums) 5 { 6 sort(nums.begin(),nums.end(),less()); 7 int result = 0; 8 if((nums.s... 阅读全文
posted @ 2018-11-13 18:23 Asurudo 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution 2 { 3 public: 4 int rangeSumBST(TreeNode* root, int L, int R) 5 { 6 int result = 0; 7 if(root->left) 8 result += r... 阅读全文
posted @ 2018-11-13 18:06 Asurudo 阅读(474) 评论(0) 推荐(0) 编辑