René's URL Explorer Experiment


Title: #290 - Word Pattern - LeetCode JavaScript Solutions

Open Graph Title: #290 - Word Pattern - LeetCode JavaScript Solutions

X Title: #290 - Word Pattern - LeetCode JavaScript Solutions

Description: Given a pattern and a string s, find if s follows the same pattern. Here follow means a full match, such that there is a bijection between a...

Open Graph Description: Given a pattern and a string s, find if s follows the same pattern. Here follow means a full match, such that there is a bijection between a...

X Description: Given a pattern and a string s, find if s follows the same pattern. Here follow means a full match, such that there is a bijection between a...

Keywords:

Opengraph URL: https://leetcodejavascript.com/solutions/word-pattern

direct link

Domain: leetcodejavascript.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"Code","url":"https://leetcodejavascript.com/solutions/word-pattern","name":"#290 - Word Pattern - LeetCode JavaScript Solutions","description":"Given a pattern and a string s, find if s follows the same pattern. Here follow means a full match, such that there is a bijection between a...","programmingLanguage":"JavaScript","codeRepository":"https://github.com/JoshCrozier/leetcode-javascript","codeSampleType":"JavaScript","text":"/**\n * @param {string} pattern\n * @param {string} s\n * @return {boolean}\n */\nvar wordPattern = function(pattern, s) {\n const words = s.split(' ');\n if (pattern.length !== words.length) return false;\n const map = new Map();\n return pattern.split('').every((char, i) =>\n map.has(char)\n ? map.get(char) === words[i]\n : !([...map.values()].includes(words[i])) && map.set(char, words[i])\n );\n};","keywords":"LeetCode 290, #290 - Word Pattern, Easy, JavaScript solution","learningResourceType":"Code","isAccessibleForFree":true,"educationalLevel":"intermediate","interactivityType":"mixed"}

authorLeetCodeJavascript.com
og:typearticle
og:imagehttps://leetcodejavascript.com/og-image.jpg
og:site_nameLeetCode JavaScript Solutions
twitter:cardsummary_large_image
twitter:urlhttps://leetcodejavascript.com/solutions/word-pattern
twitter:imagehttps://leetcodejavascript.com/og-image.jpg
twitter:creator@joshcrozier
theme-color#1f2937

Links:

LeetCodeJavascript.com https://leetcodejavascript.com/
Star on GitHubhttps://github.com/JoshCrozier/leetcode-javascript
Back to all solutionshttps://leetcodejavascript.com
View on LeetCode https://leetcode.com/problems/word-pattern/
View on GitHubhttps://github.com/JoshCrozier/leetcode-javascript/blob/master/solutions/0290-word-pattern.js
String https://leetcodejavascript.com/tags/string
Hash Tablehttps://leetcodejavascript.com/tags/hash-table
Josh Crozierhttps://joshcrozier.com

Viewport: width=device-width,initial-scale=1

Robots: index, follow


URLs of crawlers that visited me.