All Questions
7 questions
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 ...
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 telephone ...
1
vote
1
answer
127
views
Count all possible attendance records with length n, which will be regarded as rewardable
Given a positive integer n, return the number of all possible attendance records with length n, which will be regarded as rewardable. The answer may be very large, return it after \$\mod 10^9 + 7\$.
...
4
votes
1
answer
427
views
Counting ways to fit bottles in crates
I'm calculating how many possibilities there are to fit \$n\$ identical bottles inside \$k\$ crates of various capacities.
n = Number of bottles
k = Number of crates
K = List of the number of bottles ...
11
votes
2
answers
453
views
You need to diversify your strings
Challenge:
Write a program which prints all the permutations of a string in alphabetical order.
Specifications:
Your program should accept a file as its first argument.
The file contains input ...
4
votes
4
answers
9k
views
Staircase problem solved using recursion
Problem
Question taken from here.
I want to go up a flight of stairs that has n steps. I can either take 1 or 2 steps each time. How many different ways can I go up this flight of stairs? Write a ...
8
votes
2
answers
4k
views
Consecutive Primes challenge at CodeEval.com and memory allocation issue
I finally solved this challenge with using recursion and figured out why the automatic scorer wasn't passing my previous solutions. I was using NSMutableArray to ...