GitHub - P-1256/DSA_Problem · GitHub
Skip to content

P-1256/DSA_Problem

Folders and files

Repository files navigation

Approach

  1. Used a for loop starting from i=a.

  2. Increased i by d each time.

  3. Stoped when value of i exceeds b.

  4. If the number is even (i % 2 == 0), add it to evenSum.

  5. Print the final sum.

  6. Time Complexity -> O((p) where p=(b-a)/d

  7. Space Complexity -> O(1)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

Languages