Writing the Ruby Code
Write the Ruby code that as input data accepts a mass of three numbers (full numbers). The code must change these numbers so that they meet the following requirements:
1 . Each number should be divided into three.
2nd The sum of all three numbers should be as much as possible.
Changing a number means increasing (reduction is not permitted) any of its numbers. Increasing a number per unit means one change, that is, increasing a number by five means five changes. A total of six changes can be made for all three numbers.
For example:
1 . [110, 222, 3333] can be changed to [111, 222, 3333] - this is one change
2nd [111, 222, 33] can be replaced by [114, 333, 33] - here we have six changes
You can distribute the changes between the numbers at your own discretion. Number 9 cannot be changed.
Examples of decision
Input: [784, 4765, 5291]
Published by: [984, 6765, 6291]
Client's review of cooperation with Taras Mosiienko
Writing the Ruby CodeIt was pleasant to work with such a professional, all clearly and affordably scheduled, work on 5+, I recommend
Freelancer's review of cooperation with Arslan Myratdurdyyev
Writing the Ruby CodeEverything was good and correct.
-
759 4 0 I will be glad to help. The algorithm is clear. Yes, I understood, maximum 6 changes - guarantee the solvency of the task.
-
Либо количество изменений ограничено (и должно подаваться на вход), либо ответом будут все 9. Условие не полное?
-
Current freelance projects in the category Web Programming
Parsing products, preparation for import to WPScrape the full catalog of these websites: https://svit-mebliv.ua/ https://kompanit.com.ua/ru https://amia.com.ua/ https://mebliromax.com.ua/ https://pehotin.com.ua/catalog/ https://www.sokme.ua/ru/ All products need to be combined into one general table for import into WP.… Web Programming, Data Parsing ∙ 10 hours 4 minutes back ∙ 31 proposals |
Integration of a service cost calculator on the Webflow site
330 USD
We are looking for a developer to integrate a ready-made service cost calculator into our website, created on Webflow. About the company We are engaged in: furniture assembly; TV mounting; mounting shelves, pictures, mirrors, and other items; moving help; heavy lifting; handyman… Javascript and Typescript, Web Programming ∙ 13 hours 7 minutes back ∙ 43 proposals |
Create a website and connect it to Shopifyto create a website and connect it to Shopify the main page is in the mockup there will be no product pages, there will be a modal window for selecting the size of the cream jar and its quantity after that, a delivery and payment window the order must be sent to Shopify with… HTML & CSS, Web Programming ∙ 14 hours 54 minutes back ∙ 55 proposals |
Looking for a Bitrix24 specialist / CRM integrator to set up automation.Our company works with CRM Bitrix24. We need a specialist who can set up automatic addition of phone numbers to leads/orders in two formats. Automation must be correctly configured for two countries: the Republic of Moldova and Romania. Task: When creating a lead or order in… PHP, Web Programming ∙ 19 hours 29 minutes back ∙ 22 proposals |
Need a developer to create an automated AI service for generating numerology reports.
178 USD
I'm looking for a developer who can implement a turnkey automated service for generating personal numerology reports. A product concept, calculation formulas, texts, knowledge base, landing page design, and PDF report design are ready. It is necessary to combine all this into… AI & Machine Learning, Web Programming ∙ 20 hours 45 minutes back ∙ 68 proposals |