Find Jobs
Hire Freelancers

Algorithm of getting minimum sum for contiguous integer array

$10-30 USD

Completed
Posted over 2 years ago

$10-30 USD

Paid on delivery
1. Problem Description. The creator of Squid Game decided to add one more game for the players. The players are required to form a team of k members to cover a land separated into fields of different areas. Each player must be assigned a number of contiguous fields in the land where he/she have to go through the entire field to collect hidden coins. Assuming that each field can be assigned to only one player, all players must be assigned to at least one field, and that it takes a player 1 unit of time to cover 1 m2 of land, you are required to find an assignment for the players to the fields such that the maximum time it takes a player in the team to cover his/her assigned fields is minimized. The land is represented by an array of integers representing the areas of its fields in m2. For example, if k = 2 and l = [100, 100, 100, 100], then the optimal solution is to assign Player 1 to the first two fields and to assign Player 2 to the last two fields making the maximum time a player needs 200 units of time. However, if k = 2 and l = [10, 20, 30, 40], then the best solution is to assign Player 1 to the first three fields requiring 60 units of time and to assign Player 2 to the last field requiring 40 units of time making the maximum time a player needs 60 units of time. 2. Deliverables. You are required to submit one Java file named with your ID (example [login to view URL]) containing the following two methods. a) public static String naive (int k, int[] l) that implements a naive brute force solution for the problem. b) public static String efficient (int k, int[] l) that implements the most efficient solution you can think of for the problem. Both methods return a string encoding of the solution represented as follows: maxTime;P1 fields;P2 fields;...;Pk fields where maxT ime is the minimized maximum time for a player and Pi f ields for 1 ≤ i ≤ k are the areas of the fields assigned to Player i separated by commas. 3. Sample Input/Output k=2, l=[100,100,100,100] Output: 200;100,100;100,100 k=2, l=[10,20,30,40] Output: 60;10,20,30;40
Project ID: 32626036

About the project

10 proposals
Remote project
Active 2 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
I have read your problem carefully and I'm confident that I can solve this problem. Contact me. ******
$15 USD in 1 day
0.0 (0 reviews)
0.0
0.0
10 freelancers are bidding on average $25 USD for this job
User Avatar
Hi there, I checked your requirements and guarantee you it's gonna be done within the next few hours. Let's contact via chat so that I can start work immediately. Wish you the best.
$30 USD in 1 day
5.0 (52 reviews)
5.2
5.2
User Avatar
Hello, I am a software and Web Developer. I hava also lot of experience in Designing. I have some rules and regulations before start of project: 1. Provide 100% work within deadline. 2. Provide unlimited revisions until employee satisfy 100% The area of experties are: 1. Java, JavaFX, JAVA( SWing), J2EE 2. PHP, HTML, CSS, BootStrap 3. MVC, C#, .NET 4. C/C++ Programming 5. Android Applications Developmet My main target is provide you a 100% work within your deadline and low budget. You get a good result after hiring me. So click award button for more discussion. Thanks lsmd
$50 USD in 1 day
5.0 (61 reviews)
5.2
5.2
User Avatar
Hi, I believe I have an efficient solution to this interesting algorithmic problem. Please message me to discuss it further.
$28 USD in 5 days
5.0 (22 reviews)
4.9
4.9
User Avatar
Hello I just saw your requirements and after checking it I believe it is something which I can handle easily I'll provide you quality work with perfection as needed with guaranteed best rates you can sent me a message to discuss more details waiting for a response with your good name Thanks
$20 USD in 7 days
5.0 (14 reviews)
3.8
3.8
User Avatar
Algorithm expert. Hi Client, I'll provid you with clear and quick result. I'm Ihor.K algorithm expert with 5 years of experience in C/C++/C#/Python. I have a strong grip on algorithms and data structure as I not only took part but won many programming contests. You can check my certificate in my portfolio here: www.freelancer.com./u/ihorkostiuchenko I'm interested to hear more about the project. When do you need this finished? If you award me the project, I'd pleased to discuss this further and get started for you as soon as possible. I'll show you my ability and I'm looking forward to working with you for a long time. Please contact me. Thanks! Ihor
$20 USD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
I have more than 10 years experience in programming. I will guarentee you a good quality of work on time and unlimited number of revisions until your satisfaction. Please feel free to contact me in order to discuss your request.
$30 USD in 1 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of EGYPT
Cairo, Egypt
5.0
1
Payment method verified
Member since Jan 5, 2022

Client Verification

Other jobs from this client

Analysis Function
$10-30 USD
Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.