All Questions
Tagged with programming-challenge python-3.x
443
questions
1
vote
1
answer
127
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
...
6
votes
2
answers
699
views
Making a Rock Paper Scissors game in Python - How to reduce repetition and make it more effective?
I am a "new" coder to Python - saying this because I got stuck in the tutorial hell - and I saw that doing projects was a way of consolidating what I had learnt from those tutorials, so here ...
4
votes
1
answer
155
views
Roman numerals look and say sequence
I was practicing question 1 of the 2020 british informatics olympiad past paper:
The Roman look-and-say description of a string (of Is, Vs, Xs, Ls, Cs, Ds and Ms) is made by taking each
block of ...
2
votes
1
answer
127
views
Codewars 4 Kyu kata: "Most frequently used words in a text"
This was the first kata I found hard so I wanted to ask about it. Any ways I could I have done it better?
here's the question -> Most frequently used words in a text
...
3
votes
1
answer
91
views
Finding the number of "block chains" that are a certain length and begin with a certain string
I'm currently practicing for the british informatics olympiad by doing past papers.
I was doing question 3 of the 2019 paper:
A set of children’s blocks, each illustrated with a single different ...
4
votes
1
answer
426
views
Advent of Code 2023 day 1: Trebuchet
Part 1:
The task involves analyzing a calibration document containing lines of text. Each line represents a calibration value that needs to be recovered by extracting the first and last digits and ...
-1
votes
1
answer
115
views
HackerRank Project Euler 12 (Python) | Highly Divisible Triangular Numbers
I again share my Python code which didn't pass time limit test cases in the HackerRank contest of ProjectEuler.
...
3
votes
1
answer
347
views
Python function to find the count of digits of numerals in base n up to a given limit
This is a simple exercise to find the count of digits of all numerals in a given base up to a given limit (not including the limit), I wrote it to determine the ratio of bytes saved when the numbers ...
1
vote
1
answer
149
views
Calculate the cost of Biryani lessons
Problem:
According to a recent survey, Biryani is the most ordered food. Chef
wants to learn how to make world-class Biryani from a MasterChef. The
chef will be required to attend the MasterChef's ...
0
votes
1
answer
310
views
Calculate score of rock-paper-scissors (Advent of Code 2022: Day 2)
Advent of code, Day 2.
Here is my code.
Less verbose version of the question follows.
...
1
vote
2
answers
665
views
Find the cheapest flight to reach from source to destination
As the input you get the flight schedule as an array, each element of which is the price of a direct flight between 2 cities ...
2
votes
1
answer
150
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 ...
5
votes
1
answer
437
views
Connecting ropes with minimum cost
Question:
There are given N ropes of different lengths, we need to connect these ropes into one rope. The cost to connect two ropes is equal to sum of their lengths. The task is to connect the ropes ...
2
votes
0
answers
1k
views
Determining the winning bingo from a set of bingo boards and sequence of draws
I've learned Python basics about two years ago and did a few personal projects, one big one that turned out to be useful in my line of work, a few small programs for my hobbies and I've also began ...
3
votes
2
answers
391
views
Euler Project: Sums of Digit Factorials
MY CODE:
...