https://github.com/codereport/arithmetic-progression
https://github.com/codereport/arithmetic-progression
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/codereport/arithmetic-progression
- Owner: codereport
- Created: 2025-12-30T15:38:49.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2026-01-09T13:46:18.000Z (5 months ago)
- Last Synced: 2026-01-30T21:14:50.032Z (5 months ago)
- Language: C++
- Homepage:
- Size: 19.5 KB
- Stars: 4
- Watchers: 0
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This repo contains solutions to the Arithmetic Progression problem. It was coverd in this YouTube video (coming). It can be found:
* LeetCode: [Problem 1502](https://leetcode.com/problems/can-make-arithmetic-progression-from-sequence/description/)
* Perl Weekly Challenge: [Week 351, Problem 2](https://theweeklychallenge.org/blog/perl-weekly-challenge-351/)
It can be solved trivially if you have three algorithms:
* sort
* [deltas](https://hoogletranslate.com/?q=5&type=by-algo-id&expr=true&libs=true) or [map_adjacent](https://hoogletranslate.com/?q=5&type=by-algo-id)
* [all_equal](https://hoogletranslate.com/?q=51&type=by-algo-id&expr=true&libs=true)
### Array Language Solutions
| Language | Solution |
| :--------: | :------------------: |
| Jelly | `ṢIE` |
| Uiua | `/↧⧈=⧈-⍆` |
| Uiua | `=1⧻◴⧈-⍆` |
| Kap | `1=≢∪2-/∧` |
| Kap | `∧/2=/2-/∧` |
| Dyalog APL | `∧/2=/2-/⊂⍤⍋⍛⌷` |
| BQN | `1=·≠∘⍷·-´˘2↕∧` |
| Dyalog APL | `1=(≢∘∪2-/⊂⍤⍋⍛⌷)` |
| BQN | `∧´·=´˘2↕·-´˘2↕∧` |
| J | `1=[:#[:~.2-/\/:~` |
| Jello | `sort deltas all_eq` |