• 2023-08-24【LeetCode1】统计参与通信的服务器
    【题目】这里有一幅服务器分布图,服务器的位置标识在m*n的整数矩阵网格grid中,1表示单元格上有服务器,0表示没有。如果两台服务器位于同一行或者同一列,我们就认为它们之间可以进行通信。请你统计并返回能够与至少一台其他服务器进行通信的服务器的数量。【示例一】
  • 2023-05-03Leetcode1~10题整理
    1.两数之和哈希表:O(n)classSolution{public:vector<int>twoSum(vector<int>&nums,inttarget){unordered_map<int,int>hs;intn=nums.size();for(inti=0;i<n;i++){intx=target-n
  • 2023-03-17LeetCode1. 两数之和
    题目描述:给定一个整数数组nums 和一个整数目标值target,请你在该数组中找出和为目标值target 的那 两个 整数,并返回它们的数组下标。你可以假设每种输入只会对应
  • 2023-02-25【leetcode1】1. 两数之和
    题目名字两数之和链接https://leetcode-cn.com/problems/two-sum/难度简单类型数组方法暴力枚举、哈希表注:题目中数组中同一个元素不能使用两遍