Programming Question: Leetcode-17

  1. For solving the problem recursively, we need helper function , in which digits, result and empty string (current string) will be passed as well as there will be a function which will return corresponding characters for each digit.
  2. for each number in digits , we will get possible characters of that number (for 2 ‘abc’ , for 3 ‘def’ like that).
  3. We will add each possible character into the current string and call the function recursively starting form next digit.
  4. then we cut the current string from end otherwise it will be added in next steps recursively.





Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Java vs Python: A Crucial Difference Between Both Languages

Software Architecture and Docker

Root cause analysis on unusual stack writing functions with IDA.

Interning at Amazon! Pt. 1

MLH Fellowship Kicks Off

Deploying a SOAR and building an automation roadmap

A photographer captured photos of 15 pairs of dogs and their owners that look hilariously alike

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Raj shukla

Raj shukla


More from Medium

[Leetcode 525] Contiguous Array

LeetCode — Minimum Difficulty of a Job Schedule

Leetcode problem: Solving Questions With Brainpower

Sort Array By Parity — LeetCode