Skip to content

Instantly share code, notes, and snippets.

View kirainmoe's full-sized avatar
🍁

Aki kirainmoe

🍁
View GitHub Profile
class Solution {
public:
inline int lengthOfLongestSubstring(string s) {
const int maxs = 96;
int pos[maxs];
int ans = 0;
int cur = 0;
int tmp;
int length = s.length();
@kirainmoe
kirainmoe / two_sum.cpp
Last active December 18, 2016 14:01
Two sum
class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
vector<int> res;
map<int, int> numMap;
int size = nums.size();
if (size < 2) {
return res;
}