GFG POTD: 21/10/2023 | Sum of All Divisors from 1 to n | Problem of the Day

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

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

  • @impalash_ag
    @impalash_ag 8 месяцев назад +11

    Sounds like a lecturer of a college rather than an engineer at a company

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

      true

    • @Rajesh-fj5hm
      @Rajesh-fj5hm Месяц назад

      true, he himself says something else, write something else

  • @savitore
    @savitore 10 месяцев назад +1

    Harmonic lemma is not used

  • @akhilesh_14_
    @akhilesh_14_ 3 месяца назад

    easy to understand and better solution thanks bhai

  • @VivekSharma-sk3vp
    @VivekSharma-sk3vp 9 месяцев назад +1

    really nice explanation bhaiya!!

  • @GauravKumar-qe7iu
    @GauravKumar-qe7iu Год назад +1

    what if we only want the sum of divisor of MAX k element. how can we do that in that case?

  • @ayushyadav1894
    @ayushyadav1894 Год назад +1

    Can we use i*i in for loop i^²

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

      above approach is better optimised than yours.

  • @theDollarSign.
    @theDollarSign. 4 месяца назад

    WOW ,what a nice solution❤👍

  • @SaurabhKumar-jv7wh
    @SaurabhKumar-jv7wh 5 месяцев назад +1

    aisa lg rha h bhaiya mst phook k bethe h

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

    for(int i=1;i>1;i++)
    {
    cout

  • @SaurabhKumar-jv7wh
    @SaurabhKumar-jv7wh 5 месяцев назад

    import java.util.ArrayList;
    public class sumofalldivisorfrom1ton {

    static long sumOfDivisors(int N) {
    ArrayList arr = new ArrayList();
    while (N>0) {
    for (int i = 1; i * i

    • @Manoj-hl2jp
      @Manoj-hl2jp 3 месяца назад

      I think the time complexity of your solution is O(N2)
      But they are expecting lesser time complexity link mentioned below : O(N)
      static long sumOfDivisors(int n){
      Long sumOfDivisor= 0L;
      for(int i=1;i

  • @rajdeepsharma8073
    @rajdeepsharma8073 25 дней назад

    kaise teacher rbaithe hai yaar gfg main ,,,worst explanation ek badhiya engineer zaruari nahi hai ki acha teacher ho

  • @NayanMongia-pm3ho
    @NayanMongia-pm3ho 4 месяца назад +1

    worst explanation understood nothing at all