Integer to Roman | Leetcode #12

  Рет қаралды 46,925

Techdose

Techdose

Күн бұрын

Пікірлер: 44
@Santoshkumar-bb2oq
@Santoshkumar-bb2oq 2 жыл бұрын
Ur explanation is in such a way that we are getting the logic in middle of the video itself
@Lucho2027
@Lucho2027 Жыл бұрын
Thank you very much! For an awesome explanation. Just a quick note on the character mapping 90 should be equal to "XC".When you switch to the code this error is corrected, but I paused the video on your breakdown to write the code myself. Thanks so much for an awesome video
@abhijitbiradar
@abhijitbiradar 2 жыл бұрын
Many Thanks for very detailed explanation from scratch. It helped me a lot.
@psyknyt
@psyknyt Жыл бұрын
Instead of for loop use while loop int i=0; while(num>0){ if(num >= value[i]){ ans+=notation[i]; num -= value[i]; } else{ i++; } }
@manashvardhan9965
@manashvardhan9965 Жыл бұрын
Shi dimag lagaye ho beta
@chaitanyakarthikbasva
@chaitanyakarthikbasva Жыл бұрын
awesome explanation
@krishnai7637
@krishnai7637 2 жыл бұрын
Great explanation, easy to understand, thank you
@techdose4u
@techdose4u 2 жыл бұрын
Welcome :)
@oyesaurabh
@oyesaurabh Жыл бұрын
ok i understood but why we need to calculate 4, 9, 40, etc ?
@Ankitkumar-hu8kp
@Ankitkumar-hu8kp Ай бұрын
base values hai
@himanshusingla1189
@himanshusingla1189 2 жыл бұрын
Amazing thanks for such a great explaination
@techdose4u
@techdose4u 2 жыл бұрын
Welcome :)
@dynamicgamerz3366
@dynamicgamerz3366 2 жыл бұрын
Sir please make a proper video on Number to words
@akshaygoyal4118
@akshaygoyal4118 11 ай бұрын
91 is printing LCI since 90 is LC and remaining 1 is I which is wrong as per substraction mechanism it should be XCI
@pranaykumar562
@pranaykumar562 2 жыл бұрын
Boss is back 🎉
@anjanik7053
@anjanik7053 Жыл бұрын
Very nicely explained.. Thank You
@JohnSmith-g7e9x
@JohnSmith-g7e9x Жыл бұрын
I think you forget to add 6 to your cpp code. Maybe I'm wrong. I can't find it. 17:04
@Curiousss_Shivammm
@Curiousss_Shivammm Жыл бұрын
For the division approach how do I add notations[pos] x times in roman string without for loop is there any other method.
@yourhonestbro217
@yourhonestbro217 8 ай бұрын
**Division method but the time is same only the memory is improved compared to Subtraction** while(input>0){ int divide = input/val[i]; if(divide > 0){ if(divide == 2) { sb.append(symbols[i]).append(symbols[i]); } else if(divide == 3){ sb.append(symbols[i]).append(symbols[i]).append(symbols[i]); } else sb.append(symbols[i]); input = input%val[i]; } else{ i++; } }
@littlespark0
@littlespark0 Жыл бұрын
You got a new subscriber
@aditgulia272
@aditgulia272 Жыл бұрын
At 3:30 The lowest 10th multiple of 5 is 50. This means that 50 is the 10th number in the sequence of multiples of 5. Sorry i did not get that. could you please explain it.
@jayrathod9271
@jayrathod9271 Жыл бұрын
Just think in other way around. I want to make 50. So I can take 50 and 10 to make it which is minimal String
@RaunakShrivastava
@RaunakShrivastava 2 жыл бұрын
Thank you for sharing coding videos. Can you please make videos on Low Level Design as well. :) Thanks again!
@AjithKumaR-jw9wt
@AjithKumaR-jw9wt 2 жыл бұрын
Bro you find any resources to learn low level design
@NicoRitondale
@NicoRitondale 6 ай бұрын
ty for the video
@hiq8002
@hiq8002 2 жыл бұрын
why didn't you take 10,000 next to 100,000 and directly went to 1000
@ramachandrank2491
@ramachandrank2491 2 жыл бұрын
it was just an example , 10,000 wasn't an available notation in his example, thus something like 10084 had to be derived from an already available number in his notation like let's say 1000
@arnavkarforma3015
@arnavkarforma3015 6 ай бұрын
Division method class Solution { private static final int[] values = {1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1}; private static final String[] symbols = {"M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"}; public String intToRoman(int num) { StringBuilder sb = new StringBuilder(); // Loop through each symbol, stopping if num becomes 0. for (int i = 0; i < values.length && num > 0; i++) { // Repeat while the current symbol still fits into num. while (values[i] 0){ sb.append(symbols[i]); repeat --; } } } return sb.toString(); } }
@DeepakSingh-xb6fq
@DeepakSingh-xb6fq 2 жыл бұрын
Which app do you use to create the video?
@ShubhamKumar-km8pm
@ShubhamKumar-km8pm Жыл бұрын
How can we print the notation 'V' like 2 times or 3times or num/value[i] times.
@sirphiriladki5531
@sirphiriladki5531 10 ай бұрын
thank you so muchh
@sayedkhalil5996
@sayedkhalil5996 Жыл бұрын
thank you that's great
@BRAJESHKUMAR-lz4mw
@BRAJESHKUMAR-lz4mw 2 жыл бұрын
What is name of this white board software plz?
@vinitraj6268
@vinitraj6268 Жыл бұрын
Can u check for 1994
@manashvardhan9965
@manashvardhan9965 Жыл бұрын
mja aa gya
@gauravbankar4894
@gauravbankar4894 4 ай бұрын
And this question is from easy section 😂
@prasanthg562
@prasanthg562 2 жыл бұрын
Any c++course available sir
@Jaffar87
@Jaffar87 2 жыл бұрын
solve all leetcode premium questions
@umidjonkosimov
@umidjonkosimov Жыл бұрын
Why you dropped 10,000?
@vyshnavks6505
@vyshnavks6505 27 күн бұрын
7 days DSA plan not exist
@chrissimpson214
@chrissimpson214 2 жыл бұрын
ᑭяỖmo𝓼𝐦 👏
@rohit-ld6fc
@rohit-ld6fc 2 жыл бұрын
too long video for a medium problem
@jesuschristsaves1955
@jesuschristsaves1955 2 жыл бұрын
THE GOSPEL Moreover, brethren, I declare unto you the gospel which I preached unto you, which also ye have received, and wherein ye stand; 2 By which also ye are saved, if ye keep in memory what I preached unto you, unless ye have believed in vain. 3 For I delivered unto you first of all that which I also received, how that Christ died for our sins according to the scriptures; 4 And that he was buried, and that he rose again the third day according to the scriptures: - 1 Corinthians 15: 1-4 KJV Greater love hath no man than this, that a man lay down his life for his friends. - John 15:13 KJV SAVALATION For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life. - John 3:16 KJV For God sent not his Son into the world to condemn the world; but that the world through him might be saved. John 3:17 Jesus saith unto him, I am the way, the truth, and the life: no man cometh unto the Father, but by me. - John 14:6 KJV Neither is there salvation in any other: for there is none other name under heaven given among men, whereby we must be saved. Acts 4:12 For if, when we were enemies, we were reconciled to God by the death of his Son, much more, being reconciled, we shall be saved by his life. Romans 5:10 But he was wounded for our transgressions, he was bruised for our iniquities: the chastisement of our peace was upon him; and with his stripes we are healed. - Isaiah 53:5 For by grace are ye saved through faith; and that not of yourselves: it is the gift of God: Not of works, lest any man should boast. Ephesians 2:8-9 And saying, The time is fulfilled, and the kingdom of God is at hand: repent ye, and believe the gospel. - Mark 1:15 KJV He that believeth on the Son hath everlasting life: and he that believeth not the Son shall not see life; but the wrath of God abideth on him. - John 3:36 KJV Who hath saved us, and called us with an holy calling, not according to our works, but according to his own purpose and grace, which was given us in Christ Jesus before the world began. 2 Timothy 1:9 For the Son of man is come to seek and to save that which was lost. Luke 19:10 The Lord is not slack concerning his promise, as some men count slackness; but is longsuffering to us-ward, not willing that any should perish, but that all should come to repentance. 2 Peter 3:9 He that believeth and is baptized shall be saved; but he that believeth not shall be damned. Mark 16:16 For as in Adam all die, even so in Christ shall all be made alive. 1 Corinthians 15:22 For scarcely for a righteous man will one die: yet peradventure for a good man some would even dare to die. But God commendeth his love toward us, in that, while we were yet sinners, Christ died for us. Romans 5:7-8 I am the door: by me if any man enter in, he shall be saved, and shall go in and out, and find pasture. John 10:9 That if thou shalt confess with thy mouth the Lord Jesus, and shalt believe in thine heart that God hath raised him from the dead, thou shalt be saved. 10 For with the heart man believeth unto righteousness; and with the mouth confession is made unto salvation. 11 For the scripture saith, Whosoever believeth on him shall not be ashamed. - Romans 10:9-11 KJV For whosoever shall call upon the name of the Lord shall be saved. - Romans 10:13 KJV For I am not ashamed of the gospel of Christ: for it is the power of God unto salvation to every one that believeth; to the Jew first, and also to the Greek. Romans 1:16
@kanishkthegreat7993
@kanishkthegreat7993 2 жыл бұрын
bhak bc, put your jesus where sun doesn't reach
Number of islands | Leetcode #200
12:44
Techdose
Рет қаралды 185 М.
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН
Integer to Roman - Leetcode 12 - Python
9:43
NeetCode
Рет қаралды 82 М.
How to Solve ANY LeetCode Problem (Step-by-Step)
12:37
Codebagel
Рет қаралды 350 М.
Roman To Integer | Leetcode 13
10:21
Techdose
Рет қаралды 14 М.
❌ Don't Run Behind 500 LEETCODE Problems ❌ Focus on QPCD
8:31
5 Simple Steps for Solving Any Recursive Problem
21:03
Reducible
Рет қаралды 1,3 МЛН
Premature Optimization
12:39
CodeAesthetic
Рет қаралды 853 М.
The LeetCode Fallacy
6:08
NeetCode
Рет қаралды 605 М.
I gave 127 interviews. Top 5 Algorithms they asked me.
8:36
Sahil & Sarra
Рет қаралды 690 М.
Python Program To Convert Given Integer To Roman Numerals | Programs
26:09
Fastest Way to Learn ANY Programming Language: 80-20 rule
8:24
Sahil & Sarra
Рет қаралды 962 М.