标签:color for reverse targe http blank string tps style
题目:
思路:
class Solution { public: void reverseString(vector<char>& s) { int size = s.size(); int last = size - 1; for( int i = 0; i < size / 2; ++i ) //循环范围折半 { int Difference = s[ i ] - s[ last ]; s[ i ] -= Difference; s[ last-- ] += Difference; } } };
标签:color for reverse targe http blank string tps style
原文地址:https://www.cnblogs.com/sumelt/p/10467850.html