Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Count the divisible numbers #83

Open
2 tasks
shorodilov opened this issue May 14, 2023 · 4 comments
Open
2 tasks

Count the divisible numbers #83

shorodilov opened this issue May 14, 2023 · 4 comments
Assignees
Labels
assignment Represents a challenge for homework or exam
Milestone

Comments

@shorodilov
Copy link
Member

shorodilov commented May 14, 2023

Gather 3 numbers: x, y and k.
Count numbers within range [x..y] (both ends are included) that are divisible by k.
Also create a function to return these numbers.

More scientifically: { i : x ≤ i ≤ y, i mod k = 0 }

Tasks:

  • write a function to return the number of divisible items
  • write a function to return a list of divisible items
@shorodilov shorodilov added the assignment Represents a challenge for homework or exam label May 14, 2023
@shorodilov shorodilov added this to the Basics milestone May 14, 2023
@shorodilov
Copy link
Member Author

Constant time is possible (O(1)) - benchmark test required.

@Rishitha-VasiReddy
Copy link
Contributor

Hi @shorodilov, I would like to work on this issue. Could you please assign this to me.

@shorodilov
Copy link
Member Author

Hi @shorodilov, I would like to work on this issue. Could you please assign this to me.

done

@shorodilov
Copy link
Member Author

I believe calc package is a good place to implement this functions.

Naming propose:
get_divisible_by and get_divisible_by_count.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
assignment Represents a challenge for homework or exam
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants