Skip to content

Instantly share code, notes, and snippets.

View rousan's full-sized avatar
:shipit:
Building products

Rousan Ali rousan

:shipit:
Building products
View GitHub Profile
@rousan
rousan / solutions.js
Created May 29, 2017 16:45
Solution in JS
function findSomePair(arr, sum) {
arr = arr || [];
sum = sum || 0;
let outs = {},
map = new Map();
if (arr.length <= 1) {
outs["pairElementIndex1"] = -1;
@rousan
rousan / test.cpp
Created May 29, 2017 15:13
Solution of that two questions
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <unordered_map>
using namespace std;
void findSomePair(int* arr, int arrSize, int sum, int* pairElementIndex1, int* pairElementIndex2);
void testFindSomePair();
void reverse(char* arr, int start, int end);