Skip to main content

All Questions

7 votes
4 answers
942 views

Project Euler #54: class for poker hands

I'm working right now on Project Euler problem 54, and I figured that this was the perfect opportunity to try to work with classes. This is my first time, so I'm sure that there are a lot of style, ...
Brais Romero's user avatar
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
11 votes
4 answers
2k views

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 ...
CrSb0001's user avatar
  • 499
5 votes
5 answers
840 views

Bracket matching - Advent of Code 2021 Day 10

The following code solves Advent Of Code 2021 Day 10. The goal for this time around is evaluating whether a line of brackets is complete, has a syntax error or is missing some closing brackets. ...
138 Aspen's user avatar
  • 411
2 votes
1 answer
50 views

Optimal Extraction of Longest Sorted Sequence from Individually Sorted Bucket Arrays Without Repetitions

Consider a bucket array containing sorted and/or empty buckets, and the goal is to extract the longest possible sequence in sorted order, under the following conditions: Only one element in each ...
M.A.'s user avatar
  • 121
5 votes
1 answer
226 views

Performance Tuning to enable answer for Project Euler #566 "Cake Icing Puzzle"

Related to this question I am still looking for a solution to Project Euler Problem 566 (see link for a nice simulation also): Adam plays the following game with his birthday cake. He cuts a piece ...
DuesserBaest's user avatar
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
6 votes
2 answers
722 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 ...
Aldis Nuts's user avatar
4 votes
1 answer
180 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 ...
sbottingota's user avatar
  • 1,151
2 votes
1 answer
171 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 ...
Afasys's user avatar
  • 21
3 votes
1 answer
97 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 ...
sbottingota's user avatar
  • 1,151
4 votes
1 answer
454 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 ...
Madagascar's user avatar
  • 10.1k
0 votes
1 answer
126 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. ...
peternish's user avatar
3 votes
1 answer
363 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 ...
Ξένη Γήινος's user avatar
1 vote
1 answer
162 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 ...
kvk30's user avatar
  • 113

15 30 50 per page
1
2 3 4 5
30