看到这题首先想到的解法是两个for循环,进行暴力枚举即可,代码如下:
class Solution {
public:vector<int> twoSum(vector<int>& nums, int target) {vector<int> v;for(int i 0; i < nums.size() - 1; i){for(int…
.loc函数
根据行索引选取特定行
In[1]: data
Out[1]: A B C D
a 0 1 2 3
b 4 5 6 7
c 8 9 10 11
d 12 13 14 15#取索引为a的行
In[2]: data.loc[a]
Out[2]:
A 0
B 1
C 2
D 3参考博客
https://blog.csdn.net/weixin_46039719/ar…