摘要:
每一轮for循环,判断当points[i]为Boomerangs的第一个point时,第二个point和第三个point有几种情况:计算points[i]与其他每一个points[j]的距离;当距离相等的点大于等于两个时,从这些点中选两个,且则两个点有序(组合问题),就是一种情况。 class So 阅读全文
摘要:
class Solution { public: int longestPalindrome(string s) { int re=0; vector<int> vec(58,0); for(auto& c:s) { ++vec[c-'A']; } for(auto&t: vec) { re+=t/ 阅读全文
摘要:
class RandomizedCollection { unordered_map<int,unordered_set<int>> m; vector<int> vals; public: /** Initialize your data structure here. */ Randomized 阅读全文