Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->2->3 which represents the number 123. Find …
The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the “root.” Besides the root, each house has …
April 15, 2015
algorithms, BFS, Breadth First Search, c / c++, Depth First Search, DFS, Dynamic Programming, dynamic programming, Memoization, python, Recursion
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each …
The problem is from codeforces: http://www.codeforces.com/contest/278/problem/C The problem is graph-related and can be solved by many approaches. There is one exception case that you need to pay attention to: If …