L7. Count Prime in a range L-R | Maths Playlist

Поделиться
HTML-код
  • Опубликовано: 5 окт 2024
  • Notes/Codes/Problem links under day 8 of A2Z DSA Course: takeuforward.o...
    Entire playlist: • Maths Playlist | Langu...
    Follow us on our other social media handles: linktr.ee/take...

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

  • @aniketgupta8064
    @aniketgupta8064 6 месяцев назад +23

    hey striver, a request. As you upload videos, kindly also make the required updates in the A to Z sheet as well so that we wont have to find them out on YT.

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

    great!
    love your work ❤❤❤❤
    Take rest bro
    and Understood 🙂🙂

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

    Great explanation.

  • @AratrikChandra
    @AratrikChandra 6 месяцев назад +8

    can you please provide the link of the question?

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

    Great Bro; Understood well;

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

    Hey Striver, can you please provide the respective code in c++/java.

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

    Understood :))

  • @Anonymous-m3m
    @Anonymous-m3m 2 месяца назад

    class Solution {
    public:
    int count(int n) {
    vector prime(n, 1);
    int count = 0;
    for(int i = 2; i * i < n; i++) {
    if(prime[i] == 1) {
    for(int j = i * i; j < n; j += i) {
    prime[j] = 0;
    }
    }
    }
    for(int i = 2; i < n; i++) {
    if(prime[i] == 1) {
    count++;
    }
    }
    return count;
    }
    bool isPrime(int n) {
    if (n

  • @SaiKumar-mn1ee
    @SaiKumar-mn1ee 6 месяцев назад +1

    VIEDO ON OA???

  • @AkOp-bf9vm
    @AkOp-bf9vm 4 месяца назад

    notes?

  • @HimanshuKumar-sg6hv
    @HimanshuKumar-sg6hv 3 месяца назад

    can anyone explain me what is l = queries[i][0] and r = queries[i][1]

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

      Queries store the list.
      If Queries=3,
      then three range given..,
      So find primes for every range...,
      To access l and r of first query,
      l = Queries [i][0]
      r = Queries [i][1]
      Means if i=0 then it acces 0th l & r.
      If i=1 then it access 1st L & R
      And so on...,

    • @techmatein
      @techmatein 2 месяца назад

      Here queries can be seen as an array of array where the array the queries stores just have 2 indexes first for l(left) and r(right)
      So the queries stores the l and r for each query

  • @Ayushsharma-qc7qx
    @Ayushsharma-qc7qx 3 месяца назад +4

    Dimag ka bosda ho gaya bhai