diff --git a/2018-feb/adhoc-thinking/src/com/alg/top20/adhoc/TwoSum.cpp b/2018-feb/adhoc-thinking/src/com/alg/top20/adhoc/TwoSum.cpp new file mode 100644 index 0000000..3d6b3a3 --- /dev/null +++ b/2018-feb/adhoc-thinking/src/com/alg/top20/adhoc/TwoSum.cpp @@ -0,0 +1,55 @@ +#include +#include +#include +using namespace std; + +// sort and check adjacent element +int findDuplicate1(int arr[],int n){ + sort(arr,arr+n); + for(int i=1;i st; + st.insert(arr[0]); + for(int i=1;i>n; + int arr[n]; + int i; + + // generating a test case + for(i=0;i