{"id":26172275,"url":"https://github.com/imdarshangk/hackerrank","last_synced_at":"2025-07-30T23:15:50.248Z","repository":{"id":156251744,"uuid":"614011933","full_name":"imDarshanGK/HackerRank","owner":"imDarshanGK","description":"This repository showcases my solutions to various coding challenges on HackerRank. It covers a range of topics, including algorithms, data structures, and problem-solving skills. The solutions are organized by categories for easy navigation. ","archived":false,"fork":false,"pushed_at":"2025-02-19T14:42:55.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-19T15:43:20.617Z","etag":null,"topics":["arithmetic-operators","find-a-string","finding-the-percentage","hackerrank","hackerrank-solutions","if-else","leap-year","loops"],"latest_commit_sha":null,"homepage":"https://www.hackerrank.com/profile/imDarshanGk","language":"Python","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/imDarshanGK.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":"2023-03-14T18:00:40.000Z","updated_at":"2025-02-19T14:42:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"97187fcb-bc3f-4881-bb71-112776900515","html_url":"https://github.com/imDarshanGK/HackerRank","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imDarshanGK%2FHackerRank","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imDarshanGK%2FHackerRank/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imDarshanGK%2FHackerRank/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imDarshanGK%2FHackerRank/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imDarshanGK","download_url":"https://codeload.github.com/imDarshanGK/HackerRank/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243104175,"owners_count":20236943,"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":["arithmetic-operators","find-a-string","finding-the-percentage","hackerrank","hackerrank-solutions","if-else","leap-year","loops"],"created_at":"2025-03-11T19:55:47.400Z","updated_at":"2025-03-11T19:55:47.830Z","avatar_url":"https://github.com/imDarshanGK.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HackerRank Solutions 💻\n\n## Overview\nThis repository contains my solutions to various coding challenges and problems solved on **HackerRank**. It showcases my problem-solving skills in different domains such as algorithms, data structures, mathematics, and more.\n\n## Features\n- Solutions to multiple HackerRank problems.\n- Organized by categories (e.g., Algorithms, Data Structures).\n- Code comments explaining key concepts and steps.\n\n# Find a string\n```\nFind a string.\n\nIn this challenge, the user enters a string and a substring. You have to print the number of times that the substring occurs in the given string. String traversal will take place from left to right, not from right to left.\n\nNOTE: String letters are case-sensitive.\n\nInput Format\nThe first line of input contains the original string. The next line contains the substring.\n\nConstraints\n1 \u003c len(string) \u003c 200\n\nEach character in the string is an ascii character.\n\nOutput Format\nOutput the integer number indicating the total number of occurrences of the substring in the original string.\n\nSample Input\n    ABCDCDC\n    CDC\n    \nSample Output\n    2\n    \nConcept\nSome string processing examples, such as these, might be useful.\nThere are a couple of new concepts:\nIn Python, the length of a string is found by the function len(s), where  is the string.\n\nTo traverse through the length of a string, use a for loop:\n        for i in range(0, len(s)):\n            print (s[i])\n            \nA range function is used to loop over some length:\n        range (0, 5)\n        \nHere, the range loops over 0 to 4.5  is excluded.\n```\n\n# Finding the percentage\n```\nFinding the percentage \n\nThe provided code stub will read in a dictionary containing key/value pairs of name:[marks] for a list of students. Print the average of the marks array for the student name provided, showing 2 places after the decimal.\n\nExample\n\nmarks key:value pairs are\n'alpha': [20,30,40]\n'beta': [30,50,70]\nquery_name='beta'\n\nThe query_name is 'beta'. beta's average score is (30+50+70)/3 = 50.0 .\n\nInput Format\nThe first line contains the integer n, the number of students' records. The next n lines contain the names and marks obtained by a student, each value separated by a space. The final line contains query_name, the name of a student to query.\n\nConstraints\n* 2 \u003c n 10\n* 0 \u003c marks[i] \u003c 100\n* length of marks arrays = 3\n\nOutput Format\nPrint one line: The average of the marks obtained by the particular student correct to 2 decimal places.\n\nSample Input 0\n        3\n        Krishna 67 68 69\n        Arjun 70 98 63\n        Malika 52 56 60\n        Malika\n\nSample Output 0\n      56.00\nExplanation 0\n\nMarks for Malika are {52,56,60} whose average is 52+56+60/3 =\u003e 56\n\nSample Input 1\n      2\n      Harsh 25 26.5 28\n      Anurag 26 28 30\n      Harsh\n\nSample Output 1\n        26.50\n```\n\n# write a function\n```\nwrite a function\nTask\n\nGiven a year, determine whether it is a leap year. If it is a leap year, return the Boolean True, otherwise return False.\nNote that the code stub provided reads from STDIN and passes arguments to the is_leap function. It is only necessary to complete the is_leap function.\n\nInput Format\nRead year, the year to test.\n\nConstraints\n1900 \u003c year \u003c 10^5\n\nOutput Format\nThe function must return a Boolean value (True/False). Output is handled by the provided code stub.\n\nSample Input 0\n      1990\n\nSample Output 0\n      False\n\nExplanation 0\n1990 is not a multiple of 4 hence it's not a leap year.\n```\n\n# If Else\n```\nIf Else\nTask\n\nGiven an integer, , perform the following conditional actions:\n* If n is odd, print Weird\n* If n is even and in the inclusive range of 2 to 5, print Not Weird\n* If n is even and in the inclusive range of 6 to 20, print Weird\n* If n is even and greater than 20, print Not Weird\n\nInput Format\nA single line containing a positive integer,n .\n\nConstraints\n * 1 \u003c n \u003c 100\n \nOutput Format\nPrint Weird if the number is weird. Otherwise, print Not Weird.\n\nSample Input 0\n     3\n\nSample Output 0\n    Weird\n\nExplanation 0\nn=3\nn is odd and odd numbers are weird, so print Weird.\n\nSample Input 1\n    24\n\nSample Output 1\n    Not Weird\n     \nExplanation 1\n    n=24\n    n\u003e20 and nis even, so it is not weird.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimdarshangk%2Fhackerrank","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimdarshangk%2Fhackerrank","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimdarshangk%2Fhackerrank/lists"}