Skip to content

Instantly share code, notes, and snippets.

@dapangmao
Last active August 29, 2015 14:20
Show Gist options
  • Save dapangmao/1ca3c2983e7a0ea1f48d to your computer and use it in GitHub Desktop.
Save dapangmao/1ca3c2983e7a0ea1f48d to your computer and use it in GitHub Desktop.
//http://code2flow.com
A Q is raised;
Name of the function;
Input type and output type;
Test case;
Contrains / time / space requirements;
if (Q in [Leetcode, CareerCup] or similiar)
{
Recall the answer;
prepare the followup
}
else {
if (Q has hints)
{
if (sorted)
{
binary search
}
else if ( max or all)
{
dp or backtracking
}
else if ( bit / tree / linked list )
{
common strategies
}
else
{
data structure brainstorm
hash / stack / heap
}
}
else
{
estimate the difficulty;
ask for hints
}
}
Start to write codes;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment