https://github.com/arrmansa/leetcode-nice-solutions
Some solutions for leetcode problems that I found fun - either the algorithm or using numpy bruteforce where it shouldn't be
https://github.com/arrmansa/leetcode-nice-solutions
leetcode leetcode-python leetcode-python3 leetcode-solutions numpy python python3
Last synced: 9 months ago
JSON representation
Some solutions for leetcode problems that I found fun - either the algorithm or using numpy bruteforce where it shouldn't be
- Host: GitHub
- URL: https://github.com/arrmansa/leetcode-nice-solutions
- Owner: arrmansa
- License: unlicense
- Created: 2023-12-09T23:02:44.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-12T08:09:53.000Z (about 1 year ago)
- Last Synced: 2025-01-22T18:09:33.476Z (11 months ago)
- Topics: leetcode, leetcode-python, leetcode-python3, leetcode-solutions, numpy, python, python3
- Language: Python
- Homepage:
- Size: 81.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# leetcode-nice-solutions
Some solutions for leetcode problems that I found fun - either the algorithm or using numpy bruteforce where it shouldn't be
# Some hacks
open = print
class str:
encode = lambda x: None
__Serializer__._serialize = lambda _, x, __: None
# Some fun parsing ideas
```python
np.fromstring('[[1,10,4,2],[9,3,8,7],[15,16,17,12]]'[2:-2].replace('],[', ''), dtype=int, sep=',')
```
```python
with open('user.out', 'w') as f:
for args in zip(*([sys.stdin]*3)):
args = [int(val[:-1]) if val[-1] == '\n' else int(val) for val in args]
f.write(str(getKth(*args)))
f.write('\n')
_exit(0)
```