René's URL Explorer Experiment


Title: #1417 - Reformat The String - LeetCode JavaScript Solutions

Open Graph Title: #1417 - Reformat The String - LeetCode JavaScript Solutions

X Title: #1417 - Reformat The String - LeetCode JavaScript Solutions

Description: You are given an alphanumeric string s. (Alphanumeric string is a string consisting of lowercase English letters and digits). You have to fi...

Open Graph Description: You are given an alphanumeric string s. (Alphanumeric string is a string consisting of lowercase English letters and digits). You have to fi...

X Description: You are given an alphanumeric string s. (Alphanumeric string is a string consisting of lowercase English letters and digits). You have to fi...

Keywords:

Opengraph URL: https://leetcodejavascript.com/solutions/reformat-the-string

direct link

Domain: leetcodejavascript.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"Code","url":"https://leetcodejavascript.com/solutions/reformat-the-string","name":"#1417 - Reformat The String - LeetCode JavaScript Solutions","description":"You are given an alphanumeric string s. (Alphanumeric string is a string consisting of lowercase English letters and digits). You have to fi...","programmingLanguage":"JavaScript","codeRepository":"https://github.com/JoshCrozier/leetcode-javascript","codeSampleType":"JavaScript","text":"/**\n * @param {string} s\n * @return {string}\n */\nvar reformat = function(s) {\n  const letters = [];\n  const digits = [];\n  for (const char of s) {\n    if (isNaN(char)) {\n      letters.push(char);\n    } else {\n      digits.push(char);\n    }\n  }\n  if (Math.abs(letters.length - digits.length) > 1) {\n    return '';\n  }\n  const result = [];\n  const longer = letters.length >= digits.length ? letters : digits;\n  const shorter = longer === letters ? digits : letters;\n  for (let i = 0; i < longer.length; i++) {\n    result.push(longer[i]);\n    if (i < shorter.length) {\n      result.push(shorter[i]);\n    }\n  }\n  return result.join('');\n};","keywords":"LeetCode 1417, #1417 - Reformat The String, 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/reformat-the-string
twitter:imagehttps://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/reformat-the-string/
View on GitHub https://github.com/JoshCrozier/leetcode-javascript/blob/master/solutions/1417-reformat-the-string.js
String https://leetcodejavascript.com/tags/string
Josh Crozierhttps://joshcrozier.com

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

Robots: index, follow


URLs of crawlers that visited me.