Multiply Strings | Leetcode 43 Solution in Hindi

preview_player
Показать описание

NADOS also enables doubt support, career opportunities and contests besides free of charge content for learning. 1. Given two non-negative integers num1 and num2 represented as strings.
2. Return the product of num1 and num2, also represented as a string.
3. Note: You must not use any built-in BigInteger library or convert the inputs to integer directly.

Topic: #Multipliaction, #longRange, #Maths

Used #DataStructure: #Arrays, #Strings

#TimeComplexity: O(m * n)

#SpaceComplexity: O(m + n)

--------------------------------------------------------------

Smimilar Questions:

---------------------------------------------------------------

----------------------------------------------------------------

#Arrays, #String, #multiplication, #leetcode43, #43leetcode, #pepcodingStringMultiplication, #MultiplyString



.
.
.
Happy Programming !!! Pep it up 😍🤩
.
.
.
#pepcoding #code #coder #codinglife #programming #coding #java #freeresources #datastrucutres #pepcode #competitive #competitiveprogramming #softwareengineer #engineering #engineer
Рекомендации по теме
Комментарии
Автор

such bol rha hoon sir youtube mein sabse best explanation hai yeh.❤❤❤❤

SashM
Автор

Best Teached i have ever found on Internet, What a nice explanation that Was..😊

mayanknagvanshi-yeariddbi
Автор

The best explanation on the internet. Thank you sir

kanchanjeswani
Автор

OMG! Thank you so much.. Such an awesome explanation 👏🏻👏🏻...at first I was little worried as I didn't understand hindi properly so I didn't watch your video but later after watching another videos I didn't understand anything 😕...and then I come back to this channel and after watching this video I come to know that I have missed this excellent lectures from past years!...now the time is around 4 am but I want to watch some more videos of this channel . Once again thank you! 😄

jayakavya
Автор

Iss question ko karte karte thakk gaya thaa thank you sir for simplifying 🙏

snehaashishgupta
Автор

the way of explanation is awesome, Consider each points thnk u pepcoding for providing a beautiful explanations.

sharuk
Автор

Very well solved, amazing explanation. Thank you for your efforts!

sharaabsingh
Автор

We are lucky to have pepcoding and pepcoding is lucky to have teacher like shreesh sir.

aakashgoswami
Автор

Best Explanation in youtube for this problem. Thank you so much brother.This question has wasted lot of my time.

chandragirivishnuvardhan
Автор

Perfect explanantion... Thank you so much

rohitjibhakate
Автор

Nice explanation...
If we put 1 conditions then also work for negative number .

gulshanrajput
Автор

string multiply(string num1, string num2) {
if(num1 == "0" or num2 == "0"){
return "0";
}
int l1 = num1.size();
int l2 = num2.size();
vector<int> ans(l1+l2);
int i = l2 - 1;
int pf = 0;
while(i >= 0){
int j = l1-1;
int carry = 0;
int product = 1;
int k = ans.size()-1-pf;
while(j >= 0){
product = ((num2[i] -'0')*(num1[j]-'0') + carry +ans[k])%10;
carry = ((num2[i] -'0')*(num1[j]-'0') + carry +ans[k]) / 10;
ans[k--] = product;
j--;
}
ans[k--] = carry;
pf++;
i--;
}
string anss = "";
int x = 0;
while(ans[x] == 0){
x++;
}
for(;x<ans.size();x++){
anss += (ans[x] + '0');
}
return anss;
}
If anyone wants C++ version of the above explained method.

aakashparmar
Автор

This is the best explanation and a very clean and simple code for this question. Thank you so much for the video!

parthgupta
Автор

Pepcoding pr sbhi teachers bhott acha bdhate hai..

soniamalik
Автор

very well explained video god bless you

sourabhsharma
Автор

Thanks for the clear explanation....It was really very helpful.

neelam
Автор

Very nice explanation and with a clean code!!

adityaojha
Автор

You made it so easy. Liked and subscribed

arjun
Автор

Sir question aaye num 1='2'; num2='3'; iasi condition aaye string ki jo aapne operation perform karaya basie karege aaapki trah

arunchaurasiya
Автор

similar to multiply two linked lists :D

LegitGamer