diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..054367f --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,24 @@ + + + + +### Summary + +Provide a short description of the change in this pull request. + +### Checklist + +- [ ] PR title follows the format: `: ` (e.g. `fix: correct typo in solution`) +- [ ] PR description explains what and why (include references to issues if applicable) +- [ ] All new code is commented and follows repository style +- [ ] Relevant tests have been added or updated +- [ ] I have run the test suite locally and all tests pass +- [ ] The change is limited to a single problem or logical change + +### Related Issue + +If this PR addresses an existing issue, link it here: # + +### Notes for Reviewers + +Any additional information for reviewers or special steps to test. diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e012f8f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog + +This repository follows a simple changelog to keep track of notable changes. + +## Unreleased + +- test: add placeholder PR validation script and PR template for CI workflow testing + diff --git a/Python/Two_Sum/solution.py b/Python/Two_Sum/solution.py new file mode 100644 index 0000000..9735728 --- /dev/null +++ b/Python/Two_Sum/solution.py @@ -0,0 +1,19 @@ +# LeetCode Problem: Two Sum +# URL: https://leetcode.com/problems/two-sum/ +# Language: Python 3 + +from typing import List + +class Solution: + def twoSum(self, nums: List[int], target: int) -> List[int]: + seen = {} + for i, v in enumerate(nums): + need = target - v + if need in seen: + return [seen[need], i] + seen[v] = i + +# Example quick test runner (optional) +if __name__ == "__main__": + s = Solution() + print(s.twoSum([2,7,11,15], 9)) # expected [0, 1] diff --git a/scripts/validate_pr.py b/scripts/validate_pr.py new file mode 100644 index 0000000..06751ae --- /dev/null +++ b/scripts/validate_pr.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 +import os +import sys + +# Minimal non-failing PR validation placeholder +# Prints environment variables provided by the workflow so we can inspect them in the job logs. + +def main(): + print("validate_pr: placeholder — environment:") + print("PR_TITLE =", os.getenv("PR_TITLE")) + print("PR_BODY =", os.getenv("PR_BODY")) + print("BASE_SHA =", os.getenv("BASE_SHA")) + print("HEAD_SHA =", os.getenv("HEAD_SHA")) + # Add a simple hint to be visible in logs + print("validate_pr: placeholder script completed successfully.") + return 0 + +if __name__ == '__main__': + sys.exit(main())