Pierre-Marie Poitevin
Pierre-Marie Poitevin

Jun 24, 2020

·
1 min read
·

Leetcode 1486: XOR Operation in an Array

In this Leetcode problem, we compute

start XOR start + 2 XOR ... XOR start + 2n

This is the problem statement:

Problem statement

Solution

To resolve the problem, simply compute the result with brute force, here is the full code:

class Solution {
public int xorOperation(int n, int start) {
int…

--

--

More from Pierre-Marie Poitevin

Likes to code and to learn.

Recommended from Medium

InApp

InApp

Latest Backend Frameworks for Web Application Development

Daekeun Kang

Daekeun Kang

To add your local host machine as a known host on a Linux server, you can follow these steps:

Ethan Frey

Ethan Frey

in

CosmWasm

A Path to CosmWasm 1.0

Sage Knight

Sage Knight

Connect with Mina Node to be able to share 66K Mina Tokens, now!

Jonathan Hui

Jonathan Hui

QC — Programming with Quantum Gates (Single Qubits)

Gautam Thakur

Gautam Thakur

JAVA Assigment — Explore the different things

Paçoca

Paçoca

Development Report — 08/11/2022

Sebastian Witowski

Sebastian Witowski

in

Python in Plain English

Sorting Lists in Python

AboutHelpTermsPrivacy


Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Get unlimited access
Pierre-Marie Poitevin

Pierre-Marie Poitevin

179 Followers

Likes to code and to learn.

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech