Skip to main content

All Questions

6 votes
2 answers
232 views

(HackerRank) Project Euler+ #250: 250250

Link to problem: linkNumber of solvers: 27 out of 844Solve rate (per person): 3.199%Success rate (over all submissions): 1.78% Project Euler+ on HackerRank is basically supposed to be a generalization ...
CrSb0001's user avatar
  • 499
1 vote
1 answer
136 views

Read millions of integers from stdin and process them in Python within 2 seconds

This is a competitive programming problem which has never been solved in Python within the time limit of 2 seconds. It is about Disjoint Set Union: Source: Algorithms In Context #10: Disjoint Sets ...
Murilo Perrone's user avatar
2 votes
1 answer
154 views

LeetCode#494 target sum (dart is slower than python)

I'm trying to solve a LeetCode problem target-sum, in two languages: Python & Dart. The difference of time taken is shocking for me" Python took ~70ms while Dart took ~900ms !! Why does Dart ...
Abhishek Patil's user avatar
3 votes
2 answers
421 views

Euler Project: Sums of Digit Factorials

MY CODE: ...
CaptainPotato's user avatar
1 vote
1 answer
1k views

Python IPv6 verifier, parser and converter

This is a simple Python 3 program that verifies whether a string is a valid IPv6 address or not, parses IPv6 address to its hexadecimal and decimal values, and converts an integer to IPv6 format. I am ...
Ξένη Γήινος's user avatar
1 vote
0 answers
126 views

Python functions to serialize nested data structures human readably

See Serializing (nested) data structures in a human-readable format for more details. In the last two days I have significantly improved my function, and wrote seven implementations of it. I have ...
Ξένη Γήινος's user avatar
3 votes
2 answers
295 views

Drug Analyzer challenge

What do I need help with? I'm doing the challenge below, in which I need to increase code performance. It's currently at 63% and I need to increase it to at least 71% however I can't optimize more ...
Manassés G.'s user avatar
4 votes
2 answers
202 views

Bisection, linear recurrences and even Fibonacci numbers

So this code is yet another attempt at solving the second Project Euler problem to improve my handling of Python. The purpose of the code is to solve the problem below Each new term in the Fibonacci ...
N3buchadnezzar's user avatar
1 vote
3 answers
219 views

Count prime numbers whose rotations are all prime

This code solves Project Euler problem 35: The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime. There are thirteen such primes ...
SSSNIPD's user avatar
  • 39
3 votes
2 answers
699 views

Python 3 approximate pi using 9 algorithms

Note: this script requires gmpy2, if you are using Python 3.9.5 x64 on Windows 10 21H1 like me, then you need to download the pre-built ...
Ξένη Γήινος's user avatar
6 votes
2 answers
1k views

Python Place +,-, nothing between 1, 2, …, 9 (in this order) whose sum is 100

So this is a programming challenge I saw: Write a program that outputs all possibilities to put + or - or nothing between the numbers 1,2,…,9 (in this order) such that the result is 100. For example ...
Ξένη Γήινος's user avatar
3 votes
1 answer
540 views

Python script that converts Windows Registry Scripts (.reg) into PowerShell scripts (.ps1)

Well this a re-implementation of a PowerShell script that I wrote which does exactly the same thing, and I have ported it into Python. After a quick Google search I found that there is only one other ...
Ξένη Γήινος's user avatar
2 votes
1 answer
424 views

Find sub-list index with the closest to a given number sum

The task that I have to perform is to take an array of a specific length, and figure out which sub-list has the closest sum to another given number. Then, I need to print the index of that sub-array. ...
geoka's user avatar
  • 31
26 votes
2 answers
6k views

Printing 1,000,000 numbers in 1 sec. in Python

Here's a fairly simple task from CSES Problem Set - Permutations 1070 that reads: A permutation of integers 1,2, …, n is called beautiful if there are no adjacent elements whose difference is 1. ...
Bor's user avatar
  • 507
2 votes
1 answer
91 views

Program to move in a 2d array given instructions, array and starting position

Original problem (not in English): https://pokval21.kattis.com/problems/pokval21.robotdammsugaren How can my code be optimized? ...
isetnt's user avatar
  • 31

15 30 50 per page
1
2 3 4 5
7