{"id":23272412,"url":"https://github.com/letsdeepchat/angry-professor","last_synced_at":"2026-02-04T04:09:40.695Z","repository":{"id":153852557,"uuid":"427678463","full_name":"letsdeepchat/Angry-Professor","owner":"letsdeepchat","description":"A Discrete Mathematics professor has a class of students.  Frustrated with their lack of discipline, the professor decides to cancel class if fewer than some number of students are present when class starts. Arrival times go from on time (arrivalTime =\u003c0) to arrived late (arrivalTime\u003e0).  Given the arrival time of each student and a threshhold number of attendees, determine if the class is cancelled.  Example n=5  k=3  a = [-2,-1,0,1,2]  The first 3 students arrived on or before time. The last 2 were late. The threshold is 3 students, so class will go on. Return YES.  Note: Non-positive arrival times (arrivalTime=\u003c0) indicate the student arrived early or on time; positive arrival times (arrivalTime\u003e0) indicate the student arrived a[i] minutes late.  Return string: either YES or NO  Input Format The first line of input contains t, the number of test cases.  Each test case consists of two lines.  The first line has two space-separated integers, n and k, the number of students (size of a) and the cancellation threshold.  The second line contains n space-separated integers (a[i]) that describe the arrival times for each student.  Constraints 1\u003c=t\u003c=10 1\u003c=n\u003c=1000 1\u003c=k\u003c=n -100\u003c=a[i]\u003c=100 Sample Input 2 4 3 -1 -3 4 2 4 2 0 -1 2 1 Sample Output YES NO Explanation For the first test case, k=3. The professor wants at least 3 students in attendance, but only 2 have arrived on time ( -3 and -1) so the class is cancelled.  For the second test case, k=2. The professor wants at least 2 students in attendance, and there are 2 who arrived on time (0 and 2). The class is not cancelled.","archived":false,"fork":false,"pushed_at":"2021-11-13T13:56:04.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-12T15:41:20.379Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"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/letsdeepchat.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":"2021-11-13T13:52:21.000Z","updated_at":"2021-11-13T13:56:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"a32cee32-adcf-403e-9545-b5a5d4454aa9","html_url":"https://github.com/letsdeepchat/Angry-Professor","commit_stats":null,"previous_names":["letsdeepchat/angry-professor"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsdeepchat%2FAngry-Professor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsdeepchat%2FAngry-Professor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsdeepchat%2FAngry-Professor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsdeepchat%2FAngry-Professor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/letsdeepchat","download_url":"https://codeload.github.com/letsdeepchat/Angry-Professor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247463933,"owners_count":20942950,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-12-19T19:15:25.149Z","updated_at":"2026-02-04T04:09:40.666Z","avatar_url":"https://github.com/letsdeepchat.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"A Discrete Mathematics professor has a class of students.\n\nFrustrated with their lack of discipline, the professor decides to cancel class if fewer than some number of students are present when class starts. Arrival times go from on time (arrivalTime =\u003c0) to arrived late (arrivalTime\u003e0).\n\nGiven the arrival time of each student and a threshhold number of attendees, determine if the class is cancelled.\n\nExample\nn=5\n\nk=3\n\na = [-2,-1,0,1,2]\n\nThe first 3 students arrived on or before time. The last 2 were late. The threshold is 3 students, so class will go on. Return YES.\n\nNote:\nNon-positive arrival times (arrivalTime=\u003c0) indicate the student arrived early or on time; positive arrival times (arrivalTime\u003e0) indicate the student arrived a[i] minutes late.\n\nReturn string: either YES or NO\n\nInput Format\nThe first line of input contains t, the number of test cases.\n\nEach test case consists of two lines.\n\nThe first line has two space-separated integers, n and k, the number of students (size of a) and the cancellation threshold.\n\nThe second line contains n space-separated integers (a[i]) that describe the arrival times for each student.\n\nConstraints\n1\u003c=t\u003c=10\n1\u003c=n\u003c=1000\n1\u003c=k\u003c=n\n-100\u003c=a[i]\u003c=100\n\nSample Input\n2\n4 3\n-1 -3 4 2\n4 2\n0 -1 2 1\n\nSample Output\nYES\nNO\n\nExplanation\nFor the first test case, k=3. The professor wants at least 3 students in attendance, but only 2 have arrived on time ( -3 and -1) so the class is cancelled.\n\nFor the second test case, k=2. The professor wants at least 2 students in attendance, and there are 2 who arrived on time (0 and 2). The class is not cancelled.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fletsdeepchat%2Fangry-professor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fletsdeepchat%2Fangry-professor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fletsdeepchat%2Fangry-professor/lists"}