aayushi-droid / Edabit-Solutions

Edabit Solutions using Cpp(C++)
MIT License
39 stars 154 forks source link

XOR SWAP #215

Closed pranavbharadwaj007 closed 3 years ago

pranavbharadwaj007 commented 3 years ago

Before jumping into Pr first comment for assign.

Problem statement :This is more informational than a challenge. You can actually switch 2 variables with the XOR operation ^. XOR works with two arguments. It turns both arguments in their binary representation, and for each bit, returns 1 if they are different, 0 otherwise.

The return value is the decimal representation of the new binary string. So, if you don't know how to do it, go play around with it! After some time on paper, you will understand what is going on, and how it works.

Your job is to switch 2 variables using the XOR operator, which means your return statement should be return std::make_pair(a, b), but the variables need to be switched.

Probelm Link : click here Choose one Cateorgy - Easy question category : bit_operation,language_fundamentals


Before submitting a PR please Check some details.

This repository is vaild for HacktoberFest2020

Read before making PR - How to contribute on Github Good Luck,

pranavbharadwaj007 commented 3 years ago

@aayushi-droid pls assign this issue to me

Hitesh18082001 commented 3 years ago

please assign this issue to me. thanks!!

Gautam-Diwan commented 3 years ago

pls assign this issue

sethivansh6 commented 3 years ago

Assign me this issue or the other ones you like I can code them C++, JAVA, and JS.