Skip to main content

All Questions

Filter by
Sorted by
Tagged with
3 votes
0 answers
311 views

LeetCode: Stone Game C#

https://leetcode.com/problems/stone-game/ Alex and Lee play a game with piles of stones. There are an even number of piles arranged in a row, and each pile has a positive integer number of stones ...
Gilad's user avatar
  • 5,253
7 votes
2 answers
1k views

Letter Combinations of a phone number using a Dictionary

Problem statement (online source) Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telephone ...
Shahin's user avatar
  • 103
5 votes
2 answers
183 views

Code Challenge: basic arithmic operations using only incrementation operator

Challenge Write a function that takes 2 integer operands left and right (both >= 0) and evaluates one of the following ...
dfhwze's user avatar
  • 13.9k
2 votes
3 answers
904 views

Leetcode #91 - Number of ways to decode a string

I'm working on problem 91 on Leetcode.com called Decode Ways and I've successfully managed to get a working recursive solution but it results in Time Limited ...
springathing's user avatar
5 votes
2 answers
1k views

Finding all possible letter combinations from an inputted phone number

Prompt: Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the ...
springathing's user avatar
6 votes
2 answers
5k views

Method to remove outliers from a set of values

I'm removing outliers from a set of data using the method described here. The method removes the outliers and returns the quartile values of the set after all outliers have been removed. (...
Valuator's user avatar
  • 189
6 votes
3 answers
739 views

Recursive function challenge

Problem statement Given a list of float numbers, and four operators +, -, *, / with flat preference, find the maximum value by inserting operator between each consecutive pair of numbers. For ...
Jianmin Chen's user avatar
  • 2,396
8 votes
1 answer
157 views

AoC Day 24 2017: Electromagnetic Moat

This year's AoC has a puzzle for day 24 that was (supposedly) intended to be solved with recursion. Here is the description: --- Day 24: Electromagnetic Moat --- The CPU itself is a large, ...
Digika's user avatar
  • 113
3 votes
1 answer
840 views

Ternary tree preoder traversal (recursive implementation)

Problem statement: Print out to console the ternary tree preorder traversal. Suppose that the tree can have at most 3 children, left, middle and right. Preorder traversal is to visit the middle ...
Jianmin Chen's user avatar
  • 2,396
1 vote
0 answers
894 views

Hackerrank > Woman's CodeSprint 2 > stone division, Revisited ( recursive function)

Problem statement You have a pile of n stones that you want to split into multiple piles, as well as a set, S, of ...
Jianmin Chen's user avatar
  • 2,396
2 votes
0 answers
564 views

HackerRank university codesprint array construction

Problem statement Professor GukiZ has hobby — constructing different arrays. His best student, Nenad, gave him the following task that he just can't manage to solve: Construct an \$n\$-...
Jianmin Chen's user avatar
  • 2,396
3 votes
0 answers
410 views

CodeEval - Lucky Tickets challenge

This a solution to the CodeEval's challenge "Lucky Tickets". After a failed attempt with brute-force calculations (no surprise here), I have tried to implement an algorithm that I found on ...
Slyvain's user avatar
  • 131
2 votes
3 answers
456 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