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.





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

Recommended from Medium

Event Handling With LocalBroadcastManager Android

Build Your First Angular Application

Display XML data on HTML page and highlight the search text

ECDSA Wallet On Polkadot.js

How does Change Detection mechanism work in Angular today?

Why Discord is Sticking with React Native

Interactive zero Javascript sites with django

Expo CLI and SDK web support beta

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

Minimum cost to reach the top

Binary Tree (DFS application)

Algorithm Practice — Window Slicing — ContainerWithMostWater

Paytm Software Engineer — I (Backend) Experienced (0–1) years Interview experience