Skip to content

Instantly share code, notes, and snippets.

View nsriram's full-sized avatar

Sriram Narasimhan nsriram

  • ThoughtWorks
  • Chennai, India
View GitHub Profile
import React from 'react';
import AutoComplete from 'react-autocomplete'
const AutoCompleteWrapper = ({ selectedItem, items, onChange }) => (
<AutoComplete
getItemValue={(item) => selectedItem.label}
items={items}
renderItem={(item, isHighlighted) => <div key={item.label}>{item.label}</div>}
value={selectedItem.label}
onChange={(event, value) => onChange({ key: '', label: value })}
/**
* Steps To Run
* 1. Install NodeJS
* 2. Dowload Gist
* 3. Run from terminal node clockProblem.js
*/
const CLOCK_MAX = 12;
const CLOCK_HALF = 6;
const add = (x, y) => x + y;
-- main = print (mergeSortedList ([1,4,6,7],[0,2,5,9]))
-- some more sample inputs
-- main = print (mergeSortedList ([1,4,6,7],[]))
-- main = print (mergeSortedList ([],[0,2,5,9]))
mergeSortedList :: ([Int],[Int])->[Int]
mergeSortedList ([],ys) = ys
mergeSortedList (xs,[]) = xs
mergeSortedList ((x:xs),(y:ys))