Leetcode Weekly Contest 385 Problems 1 & 4 - Count Prefix and Suffix Pairs | Saptarshi Mukherjee

Поділитися
Вставка
  • Опубліковано 9 лис 2024

КОМЕНТАРІ • 6

  • @pratikbhagat4670
    @pratikbhagat4670 8 місяців тому +2

    for second part of the question , i was able to think during contest that we have to store all previous string and for current string check all prefixes which are also suffixes and add their count , but not able to resolve how to do all prefixes part optimally

  • @utkarshprakash7837
    @utkarshprakash7837 8 місяців тому +1

    If possible also explain last problem of recent div 3 G problem which is based on DP on trees

    • @saptarshimukherjee3908
      @saptarshimukherjee3908  8 місяців тому

      Just added an editorial. But that G problem doesn't appear DP on Trees to me, the given graph is not a tree. Its solution involves Diophantine equation. There was a Div2 contest just before that where problem D was based on Tree DP, you may check my submission to get the approach etc there. Let me know if you feel otherwise...

  • @rakshithlokesha242
    @rakshithlokesha242 8 місяців тому +1

    grt

  • @sudhadevi6692
    @sudhadevi6692 8 місяців тому

    Bhaiya if possible then plz try to explain cf div3 recent 3rd,4th question ! 🙏

    • @saptarshimukherjee3908
      @saptarshimukherjee3908  8 місяців тому +1

      I haven't checked the contest yet, I'll take a look, thanks for asking!