Forum
Usage
Spect
Browser
to conduct interviews in the
AI era
Download for Mac
Download for Windows
Satellite App
leetcode.com/problems/two-sum
1. Two Sum
Easy
Given an array of integers
nums
and an integer
target
, return
indices of the two numbers...
Example 1:
Input: nums = [2,7,11,15]
Target: 9
Output: [0,1]
class
Solution
{
public:
vector<int>
twoSum(vector<int>& nums) {
// Write solution...
unordered_map
<int,int> m;
for(int i=0; i<n; i++){
...
}
}
};
Console
Submit
AI Prevention
Multiple Display
Detection
External Device
Detection
•
SHOWCASE
•
Previous slide
Next slide
Ways candidates can cheat