{"id":20839860,"url":"https://github.com/pranavarora1895/googlehashcode2022","last_synced_at":"2026-05-03T23:32:14.823Z","repository":{"id":126789723,"uuid":"461469205","full_name":"pranavarora1895/GoogleHashcode2022","owner":"pranavarora1895","description":"Google Hashcode 2022 One Pizza Problem Solved","archived":false,"fork":false,"pushed_at":"2022-02-20T12:09:15.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-25T08:36:42.888Z","etag":null,"topics":["google","hashcode","hashcodesolved","python"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pranavarora1895.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-20T11:40:03.000Z","updated_at":"2022-02-20T12:11:07.000Z","dependencies_parsed_at":"2023-06-18T02:15:53.704Z","dependency_job_id":null,"html_url":"https://github.com/pranavarora1895/GoogleHashcode2022","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pranavarora1895/GoogleHashcode2022","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pranavarora1895%2FGoogleHashcode2022","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pranavarora1895%2FGoogleHashcode2022/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pranavarora1895%2FGoogleHashcode2022/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pranavarora1895%2FGoogleHashcode2022/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pranavarora1895","download_url":"https://codeload.github.com/pranavarora1895/GoogleHashcode2022/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pranavarora1895%2FGoogleHashcode2022/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32589096,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"ssl_error","status_checked_at":"2026-05-03T22:09:10.534Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["google","hashcode","hashcodesolved","python"],"created_at":"2024-11-18T01:14:35.675Z","updated_at":"2026-05-03T23:32:14.789Z","avatar_url":"https://github.com/pranavarora1895.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google Hashcode 2022 - One Pizza ![Google](https://img.shields.io/badge/google-4285F4?style=for-the-badge\u0026logo=google\u0026logoColor=white) ![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge\u0026logo=python\u0026logoColor=ffdd54) ![Jupyter Notebook](https://img.shields.io/badge/jupyter-%23FA0F00.svg?style=for-the-badge\u0026logo=jupyter\u0026logoColor=white) ![NumPy](https://img.shields.io/badge/numpy-%23013243.svg?style=for-the-badge\u0026logo=numpy\u0026logoColor=white) ![Pandas](https://img.shields.io/badge/pandas-%23150458.svg?style=for-the-badge\u0026logo=pandas\u0026logoColor=white)\n\n## Problem Statement\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://codejam.googleapis.com/dashboard/get_file/AQj_6U1YZSyNV0Y-_gPyr-2DCkdjytZqr_v1Att7bbxMSvZVYh_qWBQhhLGSENw/pizzeria.gif\" width=\"350\" title=\"pizza\"\u003e\n\u003c/p\u003e\n\n\u003cp\u003e\n  \n  You are opening a small pizzeria. In fact, your pizzeria is so small that you decided to offer only one type of pizza. Now you need to decide what ingredients to include (peppers? tomatoes? both?).\n\nEveryone has their own pizza preferences. Each of your potential clients has some ingredients they like, and maybe some ingredients they dislike. Each client will come to your pizzeria if both conditions are true:\n\n \u003cul\u003e\n   \u003cli\u003e all the ingredients they like are on the pizza, and\u003c/li\u003e\n   \u003cli\u003e none of the ingredients they dislike are on the pizza\u003c/li\u003e\n  \u003c/ul\u003e\nEach client is OK with additional ingredients they neither like or dislike being present on the pizza. Your task is to choose which ingredients to put on your only pizza type, to maximize the number of clients that will visit your pizzeria.\n\nInput\n\u003cul\u003e\n  \u003cli\u003eThe first line contains one integer 1≤C≤10^5 - the number of potential clients.\u003c/li\u003e\n\u003cli\u003eThe following 2×C lines describe the clients’ preferences in the following format:\u003c/li\u003e\n  \u003col\u003e\n\u003cli\u003eFirst line contains integer 1≤L≤5, followed by L names of ingredients a client likes, delimited by spaces.\u003c/li\u003e\n\u003cli\u003eSecond line contains integer 0≤D≤5, followed by D names of ingredients a client dislikes, delimited by spaces.\u003c/li\u003e\n  \u003c/ul\u003e\nEach ingredient name consists of between 1 and 15 ASCII characters. Each character is one of the lowercase letters (a-z) or a digit (0-9).\n  \n  \u003c/p\u003e\n  \n  \u003ch2\u003eSubmission\u003c/h2\u003e\n  \u003cp\u003e The submission should consist of one line consisting of a single number 0≤N followed by a list of N ingredients to put on the only pizza available in the pizzeria, separated by spaces. The list of ingredients should contain only the ingredients mentioned by at least one client, without duplicates. \u003c/p\u003e\n  \n  \u003ch2\u003eScoring\u003c/h2\u003e\n  \u003cp\u003eA solution scores one point for each client that will come to your pizzeria. A client will come to your pizzeria if **all the ingredients they like** are on the pizza and **none of the ingredients they dislike** are on the pizza.\u003c/p\u003e\n  \n  \u003ch2\u003eSample\u003c/h2\u003e\n  \n **Sample Input**\n  \n  ```\n  3\n2 cheese peppers\n0\n1 basil\n1 pineapple\n2 mushrooms tomatoes\n1 basil\n  ```\n  \n  **Sample Output**\n  \n  ```\n  4 cheese mushrooms tomatoes peppers\n  ```\n  \n  \u003cp\u003e\n \n  _**In the Sample Input there are 3 potential clients:**_\n\n- The first client likes 2 ingredients, cheese and peppers, and does not dislike anything.\n- The second client likes only basil and dislikes only pineapple.\n- The third client likes mushrooms and tomatoes and dislikes only basil\n  \n  _**In this particular Sample Output, we choose to use 4 ingredients in the pizza: cheese, mushrooms, tomatoes, and peppers.**_\n  \n- The first client likes the pizza because it contains both cheese and peppers, which they like.\n- The second client does not like the pizza: it does not contain basil which they like.\n- The third client likes the pizza because it contains mushrooms and tomatoes, which they like, and does not contain basil which they do not like.\n\n  This means a submission of this output would score 2 points for this case, because two clients (the first and third ones) would like this pizza.\n  \u003c/p\u003e\n  \n  ## Solution\n  \n  The solution is given in the attached [Jupyter Notebook](https://github.com/pranavarora1895/GoogleHashcode2022/blob/main/PractisePizza.ipynb). The scores on the different test cases were as follows:\n  \n  - A - An Example =\u003e 2\n  - B - Basic =\u003e 5\n  - C - Coarse =\u003e 1\n  - D - Difficult =\u003e 1420\n  - E - Elaborate =\u003e 412\n  - T - Total =\u003e 1840\n\n---\n\n* Follow Me On Instagram at [Pranav Arora](https://www.instagram.com/arorapranav187)\n* Lets Get Connected on Linkedin at [Pranav Arora](https://www.linkedin.com/in/pranav-arora-354b71bb/)\n\n\n### ThankYou!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpranavarora1895%2Fgooglehashcode2022","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpranavarora1895%2Fgooglehashcode2022","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpranavarora1895%2Fgooglehashcode2022/lists"}