Answer the question
In order to leave comments, you need to log in
How to slow down transform?
Hello. I need to make it go up when hovering over an element. I did so
.v:hover {
transform: translate3d(0, -14px, 0);
transition: 0.3s;
}
Answer the question
In order to leave comments, you need to log in
If N=20, X=3, Y=5, then our output is 8.
3, 5, 6, 9, 10, 12, 15, 18.
The frontal solution is to pass [2, N) and recalculate the required numbers.
Smart solution idea. If X and Y are guaranteed to be prime, then these same numbers are repeated in increments of X·Y.
3, 5, 6, 9, 10, 12, 15
18, 20, 21, 24, 25, 27, 30
And then think for yourself.
No need. We need to find the number of multiples of X, add the number of multiples of Y, and subtract the number of multiples of X*Y. The problem is solved without cycles, with one formula.
N=20, X=3, Y=5
⌊19/3⌋ + ⌊19/5⌋ - ⌊19/15⌋ = 6 + 3 - 1 = 8
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question