Title: #392 - Is Subsequence - LeetCode JavaScript Solutions
Open Graph Title: #392 - Is Subsequence - LeetCode JavaScript Solutions
X Title: #392 - Is Subsequence - LeetCode JavaScript Solutions
Description: Given two strings s and t, return true if s is a subsequence of t, or false otherwise. A subsequence of a string is a new string that is for...
Open Graph Description: Given two strings s and t, return true if s is a subsequence of t, or false otherwise. A subsequence of a string is a new string that is for...
X Description: Given two strings s and t, return true if s is a subsequence of t, or false otherwise. A subsequence of a string is a new string that is for...
Keywords:
Opengraph URL: https://leetcodejavascript.com/solutions/is-subsequence
Domain: leetcodejavascript.com
{"@context":"https://schema.org","@type":"Code","url":"https://leetcodejavascript.com/solutions/is-subsequence","name":"#392 - Is Subsequence - LeetCode JavaScript Solutions","description":"Given two strings s and t, return true if s is a subsequence of t, or false otherwise. A subsequence of a string is a new string that is for...","programmingLanguage":"JavaScript","codeRepository":"https://github.com/JoshCrozier/leetcode-javascript","codeSampleType":"JavaScript","text":"/**\n * @param {string} s\n * @param {string} t\n * @return {boolean}\n */\nvar isSubsequence = function(s, t) {\n if (s.length > t.length) return false;\n let count = 0;\n for (let i = 0; i < t.length; i++) {\n if (s[count] === t[i]) {\n count++;\n }\n }\n return count === s.length;\n};","keywords":"LeetCode 392, #392 - Is Subsequence, Easy, JavaScript solution","learningResourceType":"Code","isAccessibleForFree":true,"educationalLevel":"intermediate","interactivityType":"mixed"}
| author | LeetCodeJavascript.com |
| og:type | article |
| og:image | https://leetcodejavascript.com/og-image.jpg |
| og:site_name | LeetCode JavaScript Solutions |
| twitter:card | summary_large_image |
| twitter:url | https://leetcodejavascript.com/solutions/is-subsequence |
| twitter:image | https://leetcodejavascript.com/og-image.jpg |
| twitter:creator | @joshcrozier |
| theme-color | #1f2937 |
Links:
| LeetCodeJavascript.com | https://leetcodejavascript.com/ |
| Star on GitHub | https://github.com/JoshCrozier/leetcode-javascript |
| Back to all solutions | https://leetcodejavascript.com |
| View on LeetCode | https://leetcode.com/problems/is-subsequence/ |
| View on GitHub | https://github.com/JoshCrozier/leetcode-javascript/blob/master/solutions/0392-is-subsequence.js |
| String | https://leetcodejavascript.com/tags/string |
| Dynamic Programming | https://leetcodejavascript.com/tags/dynamic-programming |
| Two Pointers | https://leetcodejavascript.com/tags/two-pointers |
| Josh Crozier | https://joshcrozier.com |
Viewport: width=device-width, initial-scale=1.0
Robots: index, follow