Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requesting to update the readme explaining the code or algorithm used. #1

Open
prabhatpushp opened this issue Feb 22, 2022 · 9 comments

Comments

@prabhatpushp
Copy link

I am requesting you to explain the code please. It will be a lot of help.😊

@developwannabe
Copy link
Owner

Hi!! What part do you need me to explain?

@prabhatpushp
Copy link
Author

I don't know java. So it is quite hard for me to understand your algorithm. It would be helpful if you can guide me towards the algorithmic solution of the question or tell me the concepts that I need to know to solve this type of optimization questions. I would really appreciate a little guidance as there is not enough content about the solution of the question.

@developwannabe
Copy link
Owner

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.

@developwannabe developwannabe pinned this issue Feb 22, 2022
@prabhatpushp
Copy link
Author

so basically you are sorting the ingredient array according to (liked - disliked) count and taking the ingredients if it is increasing the final score. Thank you for you help.😊

@developwannabe
Copy link
Owner

That's it. Hope this helps!!

@prabhatpushp
Copy link
Author

There is also a point. You can also try to include all the ingredients that have no dislikes as they will only increase the score. Just a suggestion. Thank you. It really helps.

@developwannabe
Copy link
Owner

That's a cool idea! I'll try later, so you can keen an eye on this proyect!

@prabhatpushp
Copy link
Author

👍. Thanks once again.

@developwannabe
Copy link
Owner

Fun fact: I got the same puntuation doing that! Hahahaha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants