{"id":20667603,"url":"https://github.com/neckerfree/patternsforcoding","last_synced_at":"2026-04-20T15:32:17.588Z","repository":{"id":157481754,"uuid":"631073311","full_name":"NeckerFree/PatternsForCoding","owner":"NeckerFree","description":"Validate and master some common patterns solving code challenges.","archived":false,"fork":false,"pushed_at":"2023-05-21T04:33:08.000Z","size":3057,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-03-17T15:57:51.548Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","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/NeckerFree.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-04-21T21:28:16.000Z","updated_at":"2023-04-21T22:43:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"75845972-1427-4df2-ba6b-ab8fcb998ca4","html_url":"https://github.com/NeckerFree/PatternsForCoding","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"microverseinc/readme-template","purl":"pkg:github/NeckerFree/PatternsForCoding","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeckerFree%2FPatternsForCoding","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeckerFree%2FPatternsForCoding/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeckerFree%2FPatternsForCoding/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeckerFree%2FPatternsForCoding/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NeckerFree","download_url":"https://codeload.github.com/NeckerFree/PatternsForCoding/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeckerFree%2FPatternsForCoding/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32053209,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":[],"created_at":"2024-11-16T19:44:25.327Z","updated_at":"2026-04-20T15:32:17.569Z","avatar_url":"https://github.com/NeckerFree.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- PROJECT DESCRIPTION --\u003e\n\n# 📖 [PatternsForCoding] \u003ca name=\"about-project\"\u003e\u003c/a\u003e\n\n\u003e Validate and master some common patterns solving code challenges.\n\n## 🛠 Built With \u003ca name=\"built-with\"\u003e\u003c/a\u003e\n\n### Tech Stack \u003ca name=\"tech-stack\"\u003e\u003c/a\u003e\n\n\u003e Exercise 1\n\nPair with Target Sum\nProblem Statement\nGiven an array of numbers sorted in ascending order and a target sum, find a pair in the array whose sum is equal to the given target.\n\nWrite a function to return the indices of the two numbers (i.e. the pair) such that they add up to the given target.\n\nExample 1:\n\nInput: [1, 2, 3, 4, 6], target=6\nOutput: [1, 3]\nExplanation: The numbers at index 1 and 3 add up to 6: 2+4=6\nExample 2:\n\nInput: [2, 5, 9, 11], target=11\nOutput: [0, 2]\nExplanation: The numbers at index 0 and 2 add up to 11: 2+9=11\n\n\u003e Exercise 2\n\nDutch National Flag Problem (medium)\nProblem Statement\nGiven an array containing 0s, 1s and 2s, sort the array in-place. You should treat numbers of the array as objects, \nhence, we can’t count 0s, 1s, and 2s to recreate the array.\n\nThe flag of the Netherlands consists of three colors: red, white and blue; and since our input array also \nconsists of three different numbers that is why it is called Dutch National Flag problem.\n\nExample 1:\n\nInput: [1, 0, 2, 1, 0]\nOutput: [0 0 1 1 2]\nExample 2:\n\nInput: [2, 2, 0, 1, 2, 0]\nOutput: [0 0 1 2 2 2 ]\n\n\u003e Exercise 3\n\nGiven an array arr of unsorted numbers and a target sum, count all triplets in it such that arr[i] + arr[j] + arr[k] \u003c target \nwhere i, j, and k are three different indices. Write a function to return the count of such triplets.\n\nExample 1:\n\nInput: [-1, 0, 2, 3], target=3 \nOutput: 2\nExplanation: There are two triplets whose sum is less than the target: [-1, 0, 3], [-1, 0, 2]\nExample 2:\n\nInput: [-1, 4, 2, 1, 3], target=5 \nOutput: 4\nExplanation: There are four triplets whose sum is less than the target: [-1, 4, 1],[-1, 2, 1],[-1, 1, 3],[ -1, 2, 3]\n\n\u003e Exercise 3\n\nGiven a 2D array (i.e., a matrix) containing only 1s (land) and 0s (water), count the number of islands in it.\n\nAn island is a connected set of 1s (land) and is surrounded by either an edge or 0s (water). \nEach cell is considered connected to other cells horizontally or vertically (not diagonally).\n\n\u003e Exercise 4\nGiven a list of intervals, merge all the overlapping intervals to produce a list that has only mutually exclusive intervals.\n\nExample 1:\nIntervals: [[1,4], [2,5], [7,9]]\nOutput: [[1,5], [7,9]]\nExplanation: Since the first two intervals [1,4] and [2,5] overlap, we merged them into \none [1,5].\n\nExample 2:\nIntervals: [[6,7], [2,4], [5,9]]\nOutput: [[2,4], [5,9]]\nExplanation: Since the intervals [6,7] and [5,9] overlap, we merged them into one [5,9].\n\nExample 3:\nIntervals: [[1,4], [2,6], [3,5]]\nOutput: [[1,6]]\n\nhttps://www.geeksforgeeks.org/find-the-number-of-islands-using-dfs/\nhttps://www.designgurus.io/course-play/grokking-the-coding-interview\n\n\u003e Exercise 5 Cyclic Sort\nWe are given an array containing n distinct numbers taken from the range 0 to n. \nSince the array has only n numbers out of the total n+1 numbers, find the missing number.\n\nExample 1:\n\nInput: [4, 0, 3, 1]\nOutput: 2\nExample 2:\n\nInput: [8, 3, 5, 2, 4, 6, 0, 1]\nOutput: 7","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneckerfree%2Fpatternsforcoding","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneckerfree%2Fpatternsforcoding","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneckerfree%2Fpatternsforcoding/lists"}