Skip to main content

All Questions

13 questions with no upvoted or accepted answers
3votes
0answers
87views

Advent of Code 2021: day 10- Syntax Scoring

The following code solves day 10 in the advent of code challenge. The goal for this time around is evaluating whether a line of brackets is complete, has a syntax error or is missing some closing ...
N3buchadnezzar's user avatar
3votes
0answers
1kviews

Given an input string and a pattern, implement wildcard pattern matching

I have been trying to solve "Wildcard Matching" on leetcode. I know there are more "manual" ways to solve this without using the RE library. But I would like to know if passing the time limit is ...
Perplexabot's user avatar
3votes
0answers
232views

Finding the maximal bottleneck in a 2D matrix from source to destination

I recently started solving programming challenges and this one is causing me performance trouble. The problem statement is the following: You are given a 2d matrix where each cell contains an ...
tricktron's user avatar
2votes
0answers
278views

Performance challenge: Box operations (HackerRank) (C, Python)

Recently I've been doing some challenges on HackerRank and came across this one. First, I tried with Python, and then C. Both of my codes failed due to timeout restrictions. It would be very helpful, ...
Jaafarb's user avatar
2votes
0answers
2kviews

(Leetcode) Longest consecutive sequence in Python

This is a Leetcode problem - Given an unsorted array of integers, find the length of the longest consecutive elements' sequence. Your algorithm should run in \$O(n)\$ complexity. Example ...
Justin's user avatar
  • 2,585
2votes
0answers
377views

Bursting Balloons

This is a Leetcode problem - Given n balloons, indexed from 0 to n-1. Each balloon is ...
Justin's user avatar
  • 2,585
2votes
0answers
171views

Daily coding problem 18: Maximums of k-sized windows

The challenge Given an array of integers and a number k, where 1 <= k <= length of the array, compute the maximum values of each subarray of length k. For example, given array = [10, 5, 2, 7, ...
MrJoe's user avatar
  • 2,133
2votes
0answers
256views

Solo dice game (from Reiner Knizia’s Decathlon)

I'm trying to implement Reiner Knizia’s Decathlon, a set of 10 solo dice games played with 8 dices named after Decathlon events in Olympics. The first event is called "100 Metres". The player divides ...
user2341726's user avatar
2votes
0answers
1kviews

Logistic Regression using PyTorch

I want to get familiar with PyTorch and decided to implement a simple neural network that is essentially a logistic regression classifier to solve the Dogs vs. Cats problem. I move 5000 random ...
False Promise's user avatar
1vote
0answers
480views

PyQt6 program that lets you adjust the HSV values of an RGB color

I don't know how to actually describe what this script does concisely. I am writing GUI programs using PyQt6, and I want the most beautiful palette for my programs, so I browsed Wikipedia for a bunch ...
Ξένη Γήινος's user avatar
1vote
0answers
126views

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
1vote
0answers
181views

Applied Solution Based On Polya Enumeration Theorem

Problem A function solution(w, h, s) that takes 3 integers and returns the number of unique, non-equivalent configurations that can be found on a grid w blocks wide, h blocks tall and s possible ...
Anit Shrestha's user avatar
1vote
0answers
47views

Python script to replace GitHub password with tokens

I manage a fleet of IoT devices. As for now, GitHub announced that the username-password authentication would be deprecative soon, so I have to change the password on each device to the GitHub access ...
Monty_emma's user avatar

close