Skip to main content

All Questions

2 votes
3 answers
553 views

Recursive palindrome check

I'm trying to solve this which basically calls for a recursive palindrome check with some minor extra steps (Special characters and whitespace can be ignored). The test inputs' length can be 100000 ...
Yamin Siahmargooei's user avatar
1 vote
0 answers
372 views

Codewars: Path Finder

Task You are at position [0, 0] in maze NxN and you can only move in one of the four cardinal directions (i.e. North, East, South, West). Return true if you can reach position [N-1, N-1] or false ...
Михаил Спирин's user avatar
3 votes
1 answer
567 views

Find A Series of Numbers Who when Squared and Summed are equal to a given Square

I am working on a CodeWars titled 'Square into Squares. Protect trees!' it can be found here: https://www.codewars.com/kata/54eb33e5bc1a25440d000891/train/javascript I have a working solution, the ...
Cory Harper's user avatar
8 votes
1 answer
2k views

Codewars: N-dimensional Von Neumann Neighborhood in a matrix

Task: For creating this challenge on Codewars I need a very performant function that calculates Von Neumann Neighborhood in a N-dimensional array. This function will be called about 2000 times The ...
Superluminal's user avatar
4 votes
1 answer
1k views

Recursive grid traveling algorithm

I'm trying to come up with a solution to a coding challenge on Kattis, where there is a 2D grid filled with x's and o's, and the goal is to figure out whether or not a given starting coordinate can ...
Archie Gertsman's user avatar
2 votes
2 answers
1k views

Project Euler #15 in Python

I've wrote the code for Project Euler #15 and it runs amazingly fast. I know I can write it using binomials but I wanted to calculate by brute force as if I do not know Binomials. But I think it must ...
Gaurish Gangwar's user avatar
3 votes
1 answer
333 views

Hand crafted longest common sub sequence

I know that the below solution is not the best one and I am in the way to learn that stuff till then I have applied the brute force to see how far I can go with my intuition. ...
CodeYogi's user avatar
  • 5,137
8 votes
1 answer
2k views

"Dungeon Game" solution

The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out in a 2D grid. Our valiant knight (K) was initially ...
Nasst's user avatar
  • 83
3 votes
2 answers
2k views

Recursive uniform cost search that needs to be optimized

I have this uniform cost search that I created to solve Project Euler Questions 18 and 67. It takes the numbers in the txt file, places them into a two dimensional list, and then traverses them in a ...
Ethan Brouwer's user avatar
2 votes
3 answers
468 views

Project Euler 28: sum of spiral diagonals using recursion

I've solved Project Euler #28 using recursion. If this 5 × 5 spiral pattern is extended to 1001 × 1001, what would be the sum of the red diagonals? $$\begin{matrix} \color{red}{21} & 22 &...
Naren's user avatar
  • 121