Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Solutions tohttps://dailycodingproblem.com

License

NotificationsYou must be signed in to change notification settings

r1cc4rdo/daily_coding_problem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

These are my solutions tohttps://dailycodingproblem.com, a great resource to practice coding interviews.

I have copied problem definitions and examples verbatim from the one I received, but they might occasionally differfrom yours when questions have been updated to improve clarity or provide additional tests.Notes added after examples are comments of mine.

Problems

Each problem comes with a description, a unit tests' battery and a solution.

Just looking for aFizzBuzz implementation? Find a fewhere!

#DescriptionProblemSolution
01Interleave the elements of a stack using a queueproblemsolution
02Product of every other number in an arrayproblemsolution
03Serialize a tree into a string and backproblemsolution
04Find the first missing positive integerproblemsolution
05Implement Lisp's car and cdr given consproblemsolution
06Implement a XOR linked listproblemsolution
07Count the number of decodings for a messageproblemsolution
08Count the number of unival subtreesproblemsolution
09Largest sum of non-adjacent numbersproblemsolution
10Call a function after n millisecondsproblemsolution
11Implement an autocomplete systemproblemsolution
12Count the ways to climb a staircaseproblemsolution
13Longest substring made of k distinct charactersproblemsolution
14Monte-Carlo estimate of Piproblemsolution
15Pick a random element from a streamproblemsolution
16Implement an purchase orders' logproblemsolution
17Longest path in a filesystemproblemsolution
18Max of each sub-array of length kproblemsolution
19House coloring problemproblemsolution
20Find intersection between single linked listsproblemsolution
21Number of classrooms required given scheduleproblemsolution
22Split a string of words into partsproblemsolution
23Solve a mazeproblemsolution
24Implement locking in a binary treeproblemsolution
25Implement regular expression matcherproblemsolution
26Remove the kth element from a linked listproblemsolution
27Is a string of brackets well-formed?problemsolution
28Write an algorithm to justify textproblemsolution
29Run-length encoding and decodingproblemsolution
30Water trapped in an elevation mapproblemsolution
31Compute the edit distance between two stringsproblemsolution
32Possibility of arbitration in currency exchangeproblemsolution
33Compute the running median of a sequence of numbersproblemsolution
34Fewest characters to make a palindromeproblemsolution
35Segregate the values of an arrayproblemsolution
36Find the second largest node in the treeproblemsolution
37Generate the power set of a setproblemsolution
38Solve the N-queens problemproblemsolution
39Implement Conway's Game of Lifeproblemsolution
40Find the non-duplicated integerproblemsolution
41Itinerary from flights' listproblemsolution
42Subset of an array that adds up to kproblemsolution
43Implement a stack with a max() operationproblemsolution
44Determine how "out of order" an array A isproblemsolution
45Implement rand5() given rand7()problemsolution
46Find the longest contiguous palindromeproblemsolution
47Max profit from a stock time-seriesproblemsolution
48Reconstruct tree from pre-order and in-order traversalsproblemsolution
49Find the maximum sum of any contiguous subarrayproblemsolution
50Compute an arithmetic expression treeproblemsolution

How to contribute

Pull requests warmly welcomed if you spot issues with any of my solutions!

You can also contribute additional unit tests for interesting untested scenarios.

Running tests

To run all the unit tests for the provided solutions, use therun_tests.py scripts inside theproblems andlegacy directories.

Python 2.7 compatible versions

Python 2.7 compatible versions are available under thelegacy directory.


[8]ページ先頭

©2009-2025 Movatter.jp