Skip to content

Commit cd2d0e4

Browse files
committed
Sync from private repo
1 parent 1627eb9 commit cd2d0e4

File tree

218 files changed

+5925
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+5925
-2
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Sync to public repo (project-euler)
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
sync:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout private repo (project-euler-full)
15+
uses: actions/checkout@v4
16+
17+
- name: Show files in private repo
18+
run: |
19+
echo "✅ Current directory: $(pwd)"
20+
echo "✅ Files:"
21+
ls -lah
22+
23+
- name: Checkout public repo into subfolder
24+
uses: actions/checkout@v4
25+
with:
26+
repository: aryans-15/project-euler
27+
token: ${{ secrets.TARGET_REPO_PAT }}
28+
path: public-repo
29+
30+
- name: Sync files to public repo
31+
run: |
32+
echo "✅ Copying files to public repo..."
33+
rsync -av --delete --exclude='.git' ./ public-repo/
34+
echo "✅ Files now in public repo:"
35+
ls -lah public-repo
36+
37+
- name: Commit & push to public repo
38+
run: |
39+
cd public-repo
40+
git config user.name "Aryan Sharma"
41+
git config user.email "aryan.sharma0714@gmail.com"
42+
git add .
43+
echo "✅ Staged changes:"
44+
git status -s
45+
git commit -m "Sync from private repo" || echo "Nothing to commit"
46+
git push
47+
echo "🎉 Sync complete!"

.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

p100-inf/p112.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
def B(n):
2+
inc, dec = False, False
3+
for i in range(1, len(n)):
4+
inc = inc or n[i] > n[i-1]
5+
dec = dec or n[i] < n[i-1]
6+
return inc and dec
7+
8+
bouncy, total = 0, 1
9+
10+
while abs(bouncy/total - 0.99) > 1e-9:
11+
total += 1
12+
if B(str(total)):
13+
bouncy += 1
14+
15+
print(total)

public-repo/LIBRARIES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
| Problem | Library |
2+
| -------- | ------- |
3+
| 17 | [inflect](https://pypi.org/project/inflect/) |
4+
| 54 | [treys](https://pypi.org/project/treys/) |
5+
| 96 | [python-constraint](https://pypi.org/project/python-constraint/) |
6+

public-repo/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Python solutions to the first 100 Project Euler problems. All programs will run in <1min. Due to Python supporting arbitrary-precision integers, some solutions are likely unintended. Furthermore, certain solutions use external libraries, as detailed in LIBRARIES.md (to prevent spoilers).
2+
3+
Please feel free to open a PR if you find any issues or have any suggestions!
4+
5+
![Full Project Euler profile](https://projecteuler.net/profile/aryans15.png)

public-repo/files/p22.txt

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

public-repo/files/p42.txt

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)