Js-NodeJs Questions

  1. Flatten an array

    • Input:[1,2,3,[4,5,[6,7]]] & Output: [1,2,3,4,5,6,7]
  2. Find the index with maximum left and right sum difference (consider index as part of left sum)
    • Input:[4,5,1,2,3] & Output: 3
  3. Pair sum

    • Input: 8 & [1,2,3,5,4], Output : 3,5

    • Input:9 & [1,2,3,4], Output: false

  4. Find the middle element of a linked list

  5. Proper closing brackets

    • Input:{[] []} Output: true
    • Input:{}[] []} Output: false