Programming Question : Leetcode 10

  1. I solved this question with recursive approach , base case will be if there is no pattern i.e. pattern is exhausted then check whether the string is available or not , and return the boolean value accordingly.
  2. calculate starting match by comparing first letter of pattern , it can be a dot(.) or same as starting letter of string.
  3. then if there is a star in pattern, so we will have two options either use the variable or ignore it. So if we are ignoring the variable then we will have to start the pattern form 3rd character(or ignore first two characters). or if we do not want to ignore star, then we have to keep the pattern same and string will start from after first character.
  4. or else we have to match first character of both pattern and string and call the function recursively.

--

--

--

!Engineer

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

Recommended from Medium

How to Run an Email Server on React.js

Eloquent Javascript Chapter Three.

Step 1 : we will start by installing the plugin wich is Angular Tree , juste use this command:

Integration testing with Kodein

Easy authentication with itsa-react-server

How to set up React with a Ruby on Rails Project Part 2 — Redux

Looping through Arrays using VueJS

How to extend component functionality in React

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

!Engineer

More from Medium

LeetCode 843. Guess the Word

Finding the relationship between different sorting algorithms with respect to size of integer data…

Leetcode Problem : 525. Contiguous Array

3 unusual tips to shine during your interview for Junior-Mid level Software Engineers