当前位置:网站首页>Addition without addition, subtraction, multiplication and division (simple difficulty)
Addition without addition, subtraction, multiplication and division (simple difficulty)
2022-07-02 02:38:00 【Nulibiao】
Title Overview ( Simple difficulty )

Topic link :
Point me into the leetcode
Ideas and code
Train of thought display
We still choose to look at the solution of this topic , I have carefully selected the following solutions , You can watch it directly :
This solution is the best one I think
The solution of this problem is also good
Now let's talk about binary addition
Click me to enter the blog One thing to note is that binary addition is full 2 Into the 1, Then full 2 The number subtracted from the digit of is 2, Not at all 1.
You can see my blog about shift operators :
Click me to enter the blog
You can also see the introduction of this topic :
Click to enter the solution
Code example
class Solution {
public int add(int a, int b) {
while(b != 0) {
int temp = a ^ b;
int cur = (a & b) << 1;
a = temp;
b = cur;
}
return a;
}
}

边栏推荐
- 多线程查询,效率翻倍
- 2022低压电工考试题模拟考试题库模拟考试平台操作
- Divorce for 3 years to discover the undivided joint property, or
- Flutter un élément au milieu, l'élément le plus à droite
- Open那啥的搭建文档
- After marriage
- Start from scratch - Web Host - 01
- Jointly developed by nailing, the exclusive functions of glory tablet V7 series were officially launched
- Which brand of sports headset is better? Bluetooth headset suitable for sports
- [staff] restore mark (Introduction to the use of restore mark | example analysis of Metaphone mark and restore mark)
猜你喜欢

How to run oddish successfully from 0?

批量检测url是否存在cdn—高准确率

JVM面试篇

Analysis of FLV packaging format

STM32__05—PWM控制直流电机

超图iServer rest服务之feature查询

QT实现界面跳转

How to turn off the LED light of Rog motherboard

Formatting logic of SAP ui5 currency amount display
![[staff] pitch representation (treble clef | C3 60 ~ B3 71 pitch representation | C4 72 pitch representation | C5 84 pitch representation)](/img/e0/05890eafdb291c5aaff78cc241f455.jpg)
[staff] pitch representation (treble clef | C3 60 ~ B3 71 pitch representation | C4 72 pitch representation | C5 84 pitch representation)
随机推荐
Additional: information desensitization;
Feature query of hypergraph iserver rest Service
[reading notes] programmer training manual - practical learning is the most effective (project driven)
[JSON] gson use and step on the pit
Which kind of sports headphones is easier to use? The most recommended sports headphones
[staff] diacritical mark (ascending sign | descending sign B | double ascending sign x | double descending sign BB)
The video number will not be allowed to be put on the shelves of "0 yuan goods" in the live broadcasting room?
Which brand of running headphones is good? How many professional running headphones are recommended
New programmer magazine | Li Penghui talks about open source cloud native message flow system
how to add one row in the dataframe?
Multi threaded query, double efficiency
离婚3年以发现尚未分割的共同财产,还可以要么
Flutter un élément au milieu, l'élément le plus à droite
Actual battle of financial risk control - under Feature Engineering
query词权重, 搜索词权重计算
[graduation season] graduate seniors share how to make undergraduate more meaningful
Questions d'entrevue
Spend a week painstakingly sorting out the interview questions and answers of high-frequency software testing / automated testing
Ar Augmented Reality applicable scenarios
What is the difference between an intermediate human resource manager and an intermediate economist (human resources direction)?