7 kyu
Simple Fun #225: Closest Neighbor
176myjinxin2015
Description:
Task
Given a number n
, find the largest integer below n
and the smallest integer above n
that are divisible by a, b, and c
.
Input/Output
[input]
integer n
A positive integer.
10 ≤ n ≤ 3 * 10^5
[input]
integer a,b,c
1 ≤ a ≤ b ≤ c ≤ 100
[output]
an integer array
Array of two integers, the first integer is the largest number less than n and divisible by a, b and c, and the second one is the smallest number greater than n and divisible by a, b ans c.
Example
For n = 20, a = 2, b = 3, c = 4
, the output should be [12, 24]
Fundamentals
Similar Kata:
Stats:
Created | Apr 28, 2017 |
Published | Apr 28, 2017 |
Warriors Trained | 293 |
Total Skips | 4 |
Total Code Submissions | 416 |
Total Times Completed | 176 |
JavaScript Completions | 176 |
Total Stars | 4 |
% of votes with a positive feedback rating | 88% of 60 |
Total "Very Satisfied" Votes | 48 |
Total "Somewhat Satisfied" Votes | 10 |
Total "Not Satisfied" Votes | 2 |
Total Rank Assessments | 6 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |