Skip to content

Latest commit

 

History

History
16 lines (15 loc) · 693 Bytes

learn.md

File metadata and controls

16 lines (15 loc) · 693 Bytes

Key points while solving questions

  1. Read Constraints First.
  2. If constraints around 1e4 can use bitset.
  3. Disconnected components common property to be found use a dummy node.
  4. If A1 and An are adjacent double the array.
  5. Use stack to find left and right boundaries.
  6. For Mathematical problems workout small cases.
  7. Check for small inputs and hence pigeonhole priciple.
  8. Think like a brute force solution first.
  9. Think the problems in backward direction.
  10. For cyclic shifts of permutations use position indexing.
  11. Primes upto 1e7 always use linear sieve.
  12. Constructive problems make partitions.
  13. Problems with a edge contributions can be solved using DSU.