Redundant Connection: 684 - google interview question

Поделиться
HTML-код
  • Опубликовано: 27 окт 2024

Комментарии • 6

  • @alisheheryar1770
    @alisheheryar1770 6 месяцев назад

    Brute Force and then optimal solution. Not jump right to optimal solution. Its not natural I believe!

    • @DestinationFAANG
      @DestinationFAANG  6 месяцев назад +2

      I agree. But for this question, it made sense to understand optimal solution directly. However for most of the other questions, I go through brute force and then optimal.

    • @alisheheryar1770
      @alisheheryar1770 5 месяцев назад

      @@DestinationFAANG any chance of getting Brute Force solution for this?

    • @DestinationFAANG
      @DestinationFAANG  5 месяцев назад

      Brute force approach: Go through each edge, try to remove that edge, see if all the other points are connected. If yes than removed edge was the redundant connection. If not keep trying for all the edges.

  • @nagarajankaushik1
    @nagarajankaushik1 6 месяцев назад +1

    This is the first video where I'm learning about DSUs, though I've heard it multiple times before. The explanations were spot on as usual!
    Also the updated video format with the dark mode text editor, zoomed in view, readable comments and having the whole code written beforehand are a treat to the eyes! 🤍

    • @DestinationFAANG
      @DestinationFAANG  6 месяцев назад +1

      Thanks for the comment, and the previous suggestion to update the background as well.