Yahoo Interview Question

some basic Javascript coding and leetcode