2023/09/14
class Solution { public: vector<int> twoSum(vector<int>& nums, int target) { for(int i=0;i<nums.size();i++) { for(int j=i+1;j<nums.size();j++) { if(nums[i]+nums[j]==target) { return {i,j}; } } } return {}; } };
class Solution { public: bool isPalindrome(int x) { int m=0; if(x<0||(x%10==0&&x!=0)) return false; while(x>m) { m=m*10+x%10; x=x/10; } return x==m||x==(m/10); } };