Skip to main content

Questions tagged [programming-challenge]

Use this tag when the code is a solution to a programming challenge. Always include a sufficient description of the problem to be solved - while a link to the challenge is welcome, the review request needs to be complete when the challenge site is unavailable.

4 votes
3 answers
131 views

Code: https://github.com/Loki-Astari/Puzzle/tree/master/wc Challenge: https://codingchallenges.fyi/challenges/challenge-wc/ Previous attempt: Unix WC Implementation The original one would scan a 50M ...
Loki Astari's user avatar
  • 98.9k
9 votes
7 answers
1k views

Code: https://github.com/Loki-Astari/Puzzle/tree/master/wc Challenge: https://codingchallenges.fyi/challenges/challenge-wc/ wc.cpp ...
Loki Astari's user avatar
  • 98.9k
7 votes
2 answers
908 views

I wrote a JSON parser for a coding challenge: https://codingchallenges.fyi/challenges/challenge-json-parser It's a recursive descent parser that just tells whether the JSON string is of proper syntax. ...
kiner_shah's user avatar
2 votes
0 answers
135 views

TL;DR: 5 ms for part one and 0.75 seconds for part two (multi-threaded on an aged i13900K laptop); the fiddle also works as a LINQPad script (a cleaned-up version for only part one is at the end of ...
DarthGizka's user avatar
  • 2,897
7 votes
2 answers
787 views

The task is taken from LeetCode. I would appreciate an assessment of whether my coding style follows good practices. I'm fairly familiar with algorithms and data structures so I'm not really looking ...
FluidMechanics Potential Flows's user avatar
8 votes
3 answers
831 views

The task is taken from LeetCode. I would appreciate an assessment of whether my coding style follows good practices, and if there are any habits or patterns you would find concerning when working ...
FluidMechanics Potential Flows's user avatar
2 votes
3 answers
1k views

I am working on this LeetCode problem where I have to count the minimum number of operations to make all elements in an array equal to zero 3542. Minimum Operations to Convert All Elements to Zero ...
Jared McCarthy's user avatar
4 votes
2 answers
528 views

I'm resolving a problem from CodeForces: C. Beautiful XOR. This is what the code is supposed to do: You have two numbers a and b. You must transform a into b using XOR operations (...
Jared McCarthy's user avatar
5 votes
5 answers
1k views

I implemented a recursive solution that compares the left and right subtree in mirrored fashion. It works for my test cases, but I would like to know if there are any best practices that would make ...
Jared McCarthy's user avatar
0 votes
3 answers
237 views

I implemented quick sort after merge sort as part of LeetCode question for sorting an array. The solution code can be found at https://leetcode.com/problems/sort-an-array/solutions/7180269/i-...
Dovud Jo'rayev's user avatar
4 votes
3 answers
463 views

As a follow-up to my previous question, I've decided to post a follow-up question with a revised code that accommodates most of the inputs from the previous question's comments, namely: Used ...
Stony's user avatar
  • 107
5 votes
3 answers
583 views

I need to solve the following competitive programming problem from coderun.ru: Strength of a Pyramid Top The pyramid consists of n horizontal layers of blocks: the first layer contains n blocks, the ...
Stony's user avatar
  • 107
8 votes
4 answers
1k views

I am trying to solve the 909th challenge of Project Euler. It is basically about replacing specific patterns in a string until no pattern is found. A given string like ...
polfosol's user avatar
  • 329
5 votes
2 answers
434 views

I'm creating a wordsearch generator that takes a list of words and outputs a 10x10 grid (2D array) of letters. This is roughly how it works: loop over words use boolean ...
Aya Noaman's user avatar
3 votes
2 answers
267 views

Here is a third implementation, the second is in my question Place queens and rooks with the higher score (extension of the queen problem) and an initial one is in my answer for the question N queen ...
bruno's user avatar
  • 212

15 30 50 per page
1
2 3 4 5
227