Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
Prompt
To download the code, please copy the following command and execute it in the terminal
To ensure that your submitted code identity is correctly recognized by Gitee, please execute the following command.
When using the SSH protocol for the first time to clone or push code, follow the prompts below to complete the SSH configuration.
1
Generate RSA keys.
2
Obtain the content of the RSA public key and configure it in
SSH Public Keys
When using the HTTPS protocol, the command line will prompt for account and password verification as follows. For security reasons, Gitee recommends
configure and use personal access tokens instead of login passwords for cloning, pushing, and other operations.
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com':
#
Private Token
徐云天
authored
2021-06-29 17:58 +08:00
.
增加67
public class _67 {
static class Solution {
public String addBinary ( String a , String b ) {
int i = a . length ()- 1 , j = b . length ()- 1 ;
int flow = 0 ;
StringBuilder sb = new StringBuilder ();
while ( i >= 0 || j >= 0 ){
int x = i >= 0 ? a . charAt ( i ) - '0' : 0 ;
int y = j >= 0 ? b . charAt ( j ) - '0' : 0 ;
char cur = ( x + y + flow ) % 2 == 0 ? '0' : '1' ;
flow = ( x + y + flow ) / 2 ;
sb . append ( cur );
i --;
j --;
}
if ( flow == 1 ){
sb . append ( '1' );
}
return sb . reverse (). toString ();
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
马建仓 AI 助手
Java
1
https://gitee.com/xuyuntian/leetcode.git
git@gitee.com:xuyuntian/leetcode.git
xuyuntian
leetcode
leetcode
master