Possible solution to HashCode 2022 "One Pizza" with 2732 score
Please, contact me if you can improve the code!
First of all, we need to read the inputs (a_an_example, b_basic...) and take the data we think it's useful, so we can short it in a proper way.
In this case, I used ArrayList, because this class has a lot of method that are very useful to solve this problem (it's like a normal Array).
I take all the ingredients and sort them by a ratio (if liked +1, if disliked -1).
Then I made the pizzas adding the most valorated ingredients 1 by one, like this:
Ingredient with 78 rate, 76, 70...
And asking each client if they like the pizza, in that case, the pizza get +1.
Finally, I choose the most liked pizza.
Hope this helps.
-
Notifications
You must be signed in to change notification settings - Fork 0
developwannabe/HashCode-One-Pizza-2022
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Possible solution to HashCode 2022 "One Pizza" with 2732 score
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published