Fri. Dec 6th, 2019

Host your Website

Read and learn

FatCow Web Hosting $1.00/mo* Trust your web hosting to the #1 web host provider, GoDaddy!

JSer – leetCode in JavaScript #17 Letter Combinations of a Phone Number(Recursion + Iteration)

1 min read

#17 Letter Combinations of a Phone Number

A simple problem which illustrates how we can solve these kind of *all possible solutions* with Recursion(Backtrack) or Iteration(BFS).

In a Backtrack solution, just pass down the temporary data into next recursion call and just the temporary data agains our needs.

In a BFS situation, remember to add a ending identifier such as NULL to indicate that one Round is finished

Hi I’m a JavaScript engineer who is not good at algorithms,
and currently practicing leetCode online. If you are interested, maybe we can learn together.

Copyright © All rights reserved. | Newsphere by AF themes.