Sum of N | Codechef Starters 139 | Very Easy Explaination

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ก.ย. 2024
  • #codechefsolutiontoday
    #CodeChef Starters 139
    #dsa
    #codechefsolution 139
    #c++
    #coding
    #programming
    #competitive programming
    #software developer
    #software engineer
    #interview preparation
    #interview experience
    #dsa
    #139

ความคิดเห็น • 11

  • @LearnCodeHS
    @LearnCodeHS  2 หลายเดือนก่อน

    #include
    using namespace std;
    #define int long long
    bool prime[1000001];
    int prefixSum[1000001]={0};
    void SieveOfEratosthenes()
    {
    memset(prime, true, sizeof(prime));
    int e=1000001;

    for (int p = 2; p * p

  • @amankumargupta8365
    @amankumargupta8365 2 หลายเดือนก่อน +1

    searching for this type of explanation and u give it . Great work , keep doing it

  • @user-kj9oh3dr3o
    @user-kj9oh3dr3o 2 หลายเดือนก่อน

    Great Explanation!

  • @kartiknagrale1479
    @kartiknagrale1479 2 หลายเดือนก่อน

    subscribed plz keep uploading

    • @LearnCodeHS
      @LearnCodeHS  2 หลายเดือนก่อน +1

      zarur bhai

  • @udaykirankorada1771
    @udaykirankorada1771 2 หลายเดือนก่อน

    Can you tell me the time complexity of " Sum of N" Implementation in your code. Bcz I wrote same code almost and I also used sieve of Eratosthenes. But I got TLE. My code time is Klog log K + root(K) + atmost K for loop which won't go completely most of times.

    • @LearnCodeHS
      @LearnCodeHS  2 หลายเดือนก่อน

      TC is correct but are you pre-computing the prefixSumOfNPrimes?

  • @RedManta_420
    @RedManta_420 2 หลายเดือนก่อน

    How should I practice to solve these type of questions during the time control. If you can suggest me.

    • @LearnCodeHS
      @LearnCodeHS  2 หลายเดือนก่อน

      Keep grinding. Practice is the only key . Solve questions above your rating like 200-300+

  • @Ronakrewar
    @Ronakrewar 2 หลายเดือนก่อน

    Wo first permutations wala question kese hoga

    • @LearnCodeHS
      @LearnCodeHS  2 หลายเดือนก่อน

      Talking about Maximum distance permutations? This video is already uploaded on my channel