All Questions
Tagged with programming-challengepython-3.x
46 questions
7votes
3answers
3kviews
Efficiency of 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 below 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, ...
7votes
2answers
6kviews
Character Picture Grid exercise - automatetheboringstuff
Regarding the Character picture exercise located at the end the following page: https://automatetheboringstuff.com/chapter4/ Say you have a list of lists where each value in the inner lists is a ...
12votes
2answers
4kviews
CodeFights: Pipes game
Description Carlos always loved playing video games, especially the well-known computer game "Pipes". Today he finally decided to write his own version of the legendary game from scratch. In ...
7votes
2answers
447views
Finding min and max values of an iterable on the fly
This is a follow up for my question about optimizing solution for DNA Health HackerRank problem. Short re-cap: You are given 2 arrays (genes and ...
3votes
1answer
259views
Cave explorer: using stack
Story Original Link written in korean Frodo, a backcountry explorer, came to explore an underground cave with n rooms during his expedition. All rooms are numbered 0 through n-1. There are many, the ...
1vote
1answer
396views
Project Euler 34 # Digit Factorials in Python
145 is a curious number, as 1! + 4! + 5! = 1 + 24 + 120 = 145. Find the sum of all numbers which are equal to the sum of the factorial of their digits. Note: as 1! = 1 and 2! = 2 are not sums they are ...
18votes
5answers
3kviews
Flipping coins performance
This is the Flipping coins problem on CodeChef: There are \$N\$ coins kept on the table, numbered from \$0\$ to \$N - 1\$. Initially, each coin is kept tails up. You have to perform two types of ...
15votes
2answers
1kviews
Project Euler #22 - Names Scores
I programmed Problem #22 from Project Euler in Python. It works but I want to know if it really is pythonic enough. Using names.txt (right click and 'Save Link/Target As...'), a 46K text file ...
14votes
1answer
328views
Recover flights from found tickets
I just found a whole bunch of plane tickets that only have a start and destination on them. I also know the route started in a certain city. I would like to recover the (alphabetically) first possible ...
13votes
5answers
9kviews
"Algorithmic Crush" problem hitting timeout errors
This is the HackerRank problem Algorithmic Crush: You are given a list of size N, initialized with zeroes. You have to perform ...
12votes
1answer
1kviews
Print the string equivalents of a phone number
Task Old mobile phones had the ability to type characters by pressing a number. The letter a could be typed by pressing 2 once. ...
11votes
4answers
2kviews
Leetcode 93: Restore IP Addresses
(Source: Leetcode 93: Restore IP Addresses [Medium])(Topics: [String] [Backtracking]) The problem is as follows: Definition: A valid IP address is defined to consist of exactly four integers ...
8votes
4answers
2kviews
Coin Flip Streaks - correct streak condition
This is a practice task from Automate the Boring Stuff with Python. I imagine many others have asked for their version of the solution to be checked, so I apologise beforehand for boring you yet ...
7votes
2answers
6kviews
Sherlock and The Beast
I have recently written the program for the Sherlock and The Beast' HackerRank challenge. That's working fine, but the problem is that it takes too much time if a big number is given as a input. I ...
7votes
1answer
2kviews
Python program to find a word ladder transforming "four" to "five"
I saw this Puzzling problem and thought I would try to write a Python program to solve it. The task is to transform "four" to "five", forming a new four-letter word at each step, replacing one letter ...