/algorithm-problem-solutions

This is the repository where I keep all my solutions to the leetcode problems. All are typescript now.

Primary LanguageTypeScript

Learnings

  • Be aware of indexes being floating number Math.floor(number)

  • Be careful where you should use set and where you should use array

const et = new Set<string>()
  • Remember that visited graphs are not required always for directional graphs without loop for DFS

  • Initialize an array with 0 filled in

const vis = new Array(30).fill(0);
  • javascript array sort
numbers = arr.sort((a , b) => a-b)