Binary String Addition | Facebook Coding Interview Question & Answer

preview_player
Показать описание
Add two binary numbers in strings without converting them to numbers.

Рекомендации по теме
Комментарии
Автор

I am just learning Python and came across your python tutorial videos and they're so easy to understand, you do an phenomenal job explaining everything and I really appreciate your work... I just started going through your youtube page and see that you have not done a lot of youtube videos over the past year or so. I hope you pick back up again regardless of view count because you really do have amazing content that can really benefit us new coders who want to really excel in what we do. thank you man

DoubleJ
Автор

I came here to learn how to invest after listening to a guy on radio talk about the importance of investing and how he made $960, 000 in 4 months from $160k, somehow this video has helped shed light on some things, but I'm still confused, I'm a newbie and I'm open to ideas.

Maricel_oronan
Автор

Sir, please continue your DSA series.. ❤️

isratjahan
Автор

i watch the enitre advertisements, so that YK could reap benefits. that much thankful I am to you for helping me with python

thequiickbrownfox
Автор

Pretty amazing to bump into you on YouTube and see you’ve become so successful!! 😊

ywang
Автор

Hey YK your vidoes helped me to learn a lot.

clipcreator
Автор

Upload videos frequently YK. Love your approaches

venkatasriharsha
Автор

Thanks for your videos YK! Your easy-to-understand but helpful videos really inspired me to also create my own channel to help in teaching my fellow CS and IT students in the Philippines using our Filipino language 🇵🇭 Hoping that it will also grow someday ❤️

cbc-gattaran
Автор

sir your lessons are the best and they make me want to be a hacker . I really be thankful to you and your teaching skills are so good. Im from sri lanka

nethmanihansi
Автор

Hey YK ! love to see you for a new upload

madalagreeshma
Автор

Hi YK first thank you very much for your videos keep doing it. I wanted to ask you if you'll make videos for people more advanced in programming for example explaining how to improve in competitive programming or how to improve our knowledge in coding. That could help me a lot and I think a lot of people. Thank you very much. Hoping you'll read my comment.

killuakillua
Автор

hey cs dojo: one request please. can you start making your python series again. I am just a beginner, and this series you made was essential for me. everything i have (nearly) learnt was from you, so please continue. Perhaps make an intermediate series. Thanks

NripendraPatwa
Автор

Hey, YK. Thanks for uploading a new video. But you was told that, you are working on this channel full time.

NooglerNafiz
Автор

you got a great mech keeb. Thank you for you content!

dswonderchild
Автор

Please we need more coding, data structures and algorithms videos these series of vids are really helpfull pleasee keep going and thank you

michelchaghoury
Автор

I used Java to do, her is
public static String ba(String b1, String b2){
if(b1.length() < b2.length()){
String temp = b1;
b1 = b2;
b2 = temp;
}
StringBuilder result = new StringBuilder();
boolean carry = false;

for(int i = 0; i < b1.length(); i++){
int b1Index = b1.length() - 1 - i;
int b2Index = b2.length() - 1 - i;

int CountOnes = 0;
if(b1.charAt(b1Index) == '1'){
CountOnes++;
}
if(b2Index > 0 && b2.charAt(b2Index) == '1'){
CountOnes++;
}
if(carry){
CountOnes += 1;
}
if(CountOnes % 2 == 0){
result.append("0");
}else{
result.append("1");
}
if(CountOnes > 1){
carry = true;
}
}

if(carry){
result.append("1");
}
return result.reverse().toString();
}

guohaofrankwu
Автор

Do you have a video or can you explain how the len(b1) - 1 - i works ?

kauliflur
Автор

You are awesome and a good heartened people
i love u for thiss
you are a great coach

rehanaakter
Автор

What is the presentation app you used in the video?

HungNguyen-pudv
Автор

Please make the complete video set on data structures and algorithms

anuragbose