René's URL Explorer Experiment


Title: #284 - Peeking Iterator - LeetCode JavaScript Solutions

Open Graph Title: #284 - Peeking Iterator - LeetCode JavaScript Solutions

X Title: #284 - Peeking Iterator - LeetCode JavaScript Solutions

Description: Design an iterator that supports the peek operation on an existing iterator in addition to the hasNext and the next operations. Implement th...

Open Graph Description: Design an iterator that supports the peek operation on an existing iterator in addition to the hasNext and the next operations. Implement th...

X Description: Design an iterator that supports the peek operation on an existing iterator in addition to the hasNext and the next operations. Implement th...

Keywords:

Opengraph URL: https://leetcodejavascript.com/solutions/peeking-iterator

direct link

Domain: leetcodejavascript.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"Code","url":"https://leetcodejavascript.com/solutions/peeking-iterator","name":"#284 - Peeking Iterator - LeetCode JavaScript Solutions","description":"Design an iterator that supports the peek operation on an existing iterator in addition to the hasNext and the next operations. Implement th...","programmingLanguage":"JavaScript","codeRepository":"https://github.com/JoshCrozier/leetcode-javascript","codeSampleType":"JavaScript","text":"/**\n * @param {Iterator} iterator\n */\nvar PeekingIterator = function(iterator) {\n this.iterator = iterator;\n this.peekValue = iterator.next();\n};\n\n/**\n * @return {number}\n */\nPeekingIterator.prototype.peek = function() {\n return this.peekValue;\n};\n\n/**\n * @return {number}\n */\nPeekingIterator.prototype.next = function() {\n const next = this.peekValue;\n this.peekValue = this.iterator.next();\n return next;\n};\n\n/**\n * @return {boolean}\n */\nPeekingIterator.prototype.hasNext = function() {\n return this.peekValue > 0;\n};","keywords":"LeetCode 284, #284 - Peeking Iterator, Medium, 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/peeking-iterator
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/peeking-iterator/
View on GitHubhttps://github.com/JoshCrozier/leetcode-javascript/blob/master/solutions/0284-peeking-iterator.js
Array https://leetcodejavascript.com/tags/array
Design https://leetcodejavascript.com/tags/design
Iteratorhttps://leetcodejavascript.com/tags/iterator
Josh Crozierhttps://joshcrozier.com

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

Robots: index, follow


URLs of crawlers that visited me.