René's URL Explorer Experiment


Title: #2401 - Longest Nice Subarray - LeetCode JavaScript Solutions

Open Graph Title: #2401 - Longest Nice Subarray - LeetCode JavaScript Solutions

X Title: #2401 - Longest Nice Subarray - LeetCode JavaScript Solutions

Description: You are given an array nums consisting of positive integers. We call a subarray of nums nice if the bitwise AND of every pair of elements th...

Open Graph Description: You are given an array nums consisting of positive integers. We call a subarray of nums nice if the bitwise AND of every pair of elements th...

X Description: You are given an array nums consisting of positive integers. We call a subarray of nums nice if the bitwise AND of every pair of elements th...

Keywords:

Opengraph URL: https://leetcodejavascript.com/solutions/longest-nice-subarray

direct link

Domain: leetcodejavascript.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"Code","url":"https://leetcodejavascript.com/solutions/longest-nice-subarray","name":"#2401 - Longest Nice Subarray - LeetCode JavaScript Solutions","description":"You are given an array nums consisting of positive integers. We call a subarray of nums nice if the bitwise AND of every pair of elements th...","programmingLanguage":"JavaScript","codeRepository":"https://github.com/JoshCrozier/leetcode-javascript","codeSampleType":"JavaScript","text":"/**\n * @param {number[]} nums\n * @return {number}\n */\nvar longestNiceSubarray = function(nums) {\n  let result = 1;\n  let left = 0;\n  let usedBits = 0;\n\n  for (let right = 0; right < nums.length; right++) {\n    while ((usedBits & nums[right]) !== 0) {\n      usedBits ^= nums[left];\n      left++;\n    }\n    usedBits |= nums[right];\n    result = Math.max(result, right - left + 1);\n  }\n\n  return result;\n};","keywords":"LeetCode 2401, #2401 - Longest Nice Subarray, 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/longest-nice-subarray
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/longest-nice-subarray/
View on GitHub https://github.com/JoshCrozier/leetcode-javascript/blob/master/solutions/2401-longest-nice-subarray.js
Array https://leetcodejavascript.com/tags/array
Bit Manipulation https://leetcodejavascript.com/tags/bit-manipulation
Sliding Window https://leetcodejavascript.com/tags/sliding-window
Josh Crozierhttps://joshcrozier.com

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

Robots: index, follow


URLs of crawlers that visited me.