After so many days, I recollected my childhood days, where I use to play with Roman numbers, but completely forget when days have grown. Now it's because of u, I recollected them and felt enjoying by looking at your video. Thank you so much sir.
@tanaypatel84122 жыл бұрын
Saiman says teaching java, amazing...
@rutvij28114 жыл бұрын
As you have said in the end, sometimes we complicate fairly simple tasks. I was thinking about using switch case , hashmap and whatnot before I saw your approach to the question. Amazing explanation.
@elainelopes70433 жыл бұрын
Zvgdbdgsbshdbhysdhvxgdgebebsyydhnxnxnhybxsbsnh hj d vc TB hj
@elainelopes70433 жыл бұрын
Bvgz gsbhggbevgrhvfgggstztyyggf Gv Nnjbdbsbshs7dududuuddduydyydydd7yhyxyyddhhdd6hhhshdyhvhdhnjfbhhghhfgedbzgfbdehhdhejbznzhshsjsshbjnshbzb um yt
@SatyamKumar-bw4vi2 жыл бұрын
same with me
@abhinav94695 жыл бұрын
Thanks for sharing this gem. If I had not gone through this video I would have chosen a much complex approach to solve this. This solution teaches that for some 'COMPLEX-SOUNDING' problems. A simple and feasible solution exists. All we need is to stick to the basics... Thanks again for this wonderful tutorial Kaushik..God bless you.
@geovanny_alfaro5 жыл бұрын
This is such a great video, I remember the first time I encountered it in school. I went a different more convoluted route.
@ADGroupOfArtMedia15 жыл бұрын
Yeeee! I love you Man! Thanks a ton for every contribution you made in my career!
@kirant55483 жыл бұрын
One of the best optimised solution for int to roman conversion. your just awesome man
@FBHI Жыл бұрын
And here I was so proud of my code: "int unit = value % 10; value /= 10; int dozen = value % 10; value /= 10; int cent = value %10; value /= 10; int mil = value %10; value /= 10; return thousands[mil]+hundreds[cent]+tens[dozen]+units[unit];" Lot of repeated stuff honest work, then I saw the video results..... sooo much to learn =/
@sureshgarine3 жыл бұрын
wow! what a nice thinking process. many KZbinrs share logic, but to my surprise, you speak about the thought process. Thank you so much sir. can you please make leetcode playlist for all the medium level problems
@monsterhuntergo2 жыл бұрын
Amazing! my Primary-2 kid actually have this Math topic of ones, tens, and hundreds.. This is an amazing solution. Thanks so much sensei Kaushik. :)
@preethialbert96524 жыл бұрын
Please do more of these type of problems. Your explanation is very good and clear. Expecting more like this
@shrad66112 жыл бұрын
thumbs up :), and sorry for prev comment on last video
@vinayprasad46595 жыл бұрын
Wow. I did not know you started sharing leetcode questions. This is awesome. Is there a playlist?
@Java.Brains5 жыл бұрын
Thanks! Here you go: kzbin.info/aero/PLqq-6Pq4lTTZgXnsBNQwCWdKR6O6Cgk1Z Not a lot yet, but there will be more coming up. Make sure you are subscribed with notifications if you don't want to miss out! :)
@vinayprasad46595 жыл бұрын
This is super awesome Koushik. Thanks for sharing. Your videos have helped me for years. You make extremely complicated things very simple. I will keep looking for this space.
@madhug823 жыл бұрын
super one Kaushik. the approach you take to these problems is very intuitive . Thanks for this video.
@hunterlive24343 жыл бұрын
Greetings from Russia. Thanks!
@aleksapetrovic65192 жыл бұрын
Interesting. I tought we would need to do the parse at one point. This is an excellent solution.
@bhaminisundararaman60802 жыл бұрын
wow...my solution was....quite....extensive..... thank you for this lol
@shuchivarshney31914 жыл бұрын
@Java Brains - Super Awesome..!! I like the "what kind of questions you can ask from Interviewer" part of your video, this usually youtuber don't tell it. Please go ahead with Leetcode series.
@cdhagen5 жыл бұрын
Your videos keep getting better and better. Kudos!
@OzWannabe5 жыл бұрын
This will work up to 3000. You can make it work easy up to 10000 or to max_value from short (just don't pass int as argument as this can go from -2147483647 to +2147483647to . What Romans did was to add a line over a number meaning they were multiplying that number by 1000. So, if you needed to write 9000 you had IX with a line over it. So for a max short (32768) you would have the tens of thousands XXX with a line over it and then use your function to append to it.
@metamike_23 Жыл бұрын
I just answered this question on leetcode and it took me 95 lines of code to get a solution
@nerodant852 жыл бұрын
Thank you so much for making the question so easy to understand
@SaurabhkrGupta-tc7qs4 жыл бұрын
Thanks for the great explaination Kaushik. Kudos to you
@Impromptu213 жыл бұрын
Nyc one sir
@VinitKumar_Vinigem5 жыл бұрын
Thanks for sharing these.
@kbhargavi44003 жыл бұрын
Amazing sir!! Truly most clear explanation! : )
@ashvajitchauhan6085 жыл бұрын
Very helpful, It would be appreciable if you make video on cache mechanism in spring and software perform. Thanks in advance
@meeknkosi3 жыл бұрын
you explain so perfectly
@vocipy20682 жыл бұрын
When Roman Numerals were invented, there was no concept of Zero, and nobody had yet thought about negative numbers as a concept.
@NareshKumar-dw9xp4 жыл бұрын
Why do I have a fear while watching your video like you are my interviewer and I am the student ? LOL :) Videos are always awesome btw
@SuperYouthful4 жыл бұрын
Int Roman = input(); Int divide = 0; Int thousand; Int fiveHundred; Int oneHundred; Int fifty; Int ten; Int five; Int one; Thousand = Roman / 1000; Divide = Roman - 1000* Thousand; FiveHundred = Divide /500; Divide = Divide - 500 * FiveHundred; OneHundred = Divide /100; Divide = Divide - 100* Onehundred; Continue for 50 and 10 and 5 and 1... If (onethousand > 0){ For (i=onethousand, i--, i>0) System.out.print("M"); Continue for the REST OF the Num.
@shubhamsaurabh44195 жыл бұрын
Thanks you so much sir!!! This solution is amazing!!! Wonderful!!! Maja aa gaya. In the beginning i thought that this is a very tough question but the way you solve it and the solution is no doubt amazing!!! Thanks once again sir...
@raman21925 жыл бұрын
Nice one
@namratam15225 жыл бұрын
Please try uploading more and more algorithmic questions where getting logic is difficult. Example: sliding window alogos etc.
@krishanuchakraborty35005 жыл бұрын
Thanks a ton for this video, I love the way you explain the concepts, would request you to add more such unique Java Interview question videos to this series. Thanks.
@analogylibrary5 жыл бұрын
Greatly explained!!
@MaheshBabu-ys3vh4 жыл бұрын
Hi Koushik, First of all, thank you for all your lectures. Your video quality is excellent. Would you like to put list of resources you use for the video making? It will help a lot for starters like me who interested to start a youtube channel. Tools like what whiteboard app you are using, are you using apple pencil etc. Also if you have any affiliate links, Please provide them. We can use those links to purchase that help your channel too. Thanks Mate
@Satya-g5t14 күн бұрын
On the lighter side, this problem is negating the famous saying "While in Rome, do as Romans do", just the nature of problem itself, not your solution, your solution is good. 😄
@tarmagoyf955 жыл бұрын
Hi, romans didn't have the concept of negative numbers, the only use natural numbers without the 0 number
@dance_with_shivangi.4 жыл бұрын
Your voice is like sundar pichai
@MadhusudanBhosale5 жыл бұрын
Amazing logic, Sir! ✌
@saddamahmad23105 жыл бұрын
thank you very much sir for this video
@wdwuccnxcnh70223 жыл бұрын
Thanks man!
@soumavanag50253 жыл бұрын
Thanks :)
@vihangafernando66442 жыл бұрын
Hi sir i'm an intern SE and I have been following your content for sometimes. It took me more than 6hrs to complete this question. How can I improve my skills on these type of questions.I'll attach my code in another comment . Thank you for you content. Guidance from the community would be also nice :).
@vihangafernando66442 жыл бұрын
public class Calculator { public static void main(String[] args) { String s = integerToRoman(1994); System.out.println(s); } private static String integerToRoman(int input) { int[] intArr = {1,4, 5, 9,10,40, 50,90, 100,400, 500, 900,1000}; int module = 0; int value = input; StringBuilder stringBuilder = new StringBuilder(""); for (int index = intArr.length - 1; index >= 0; index--) { module = value / intArr[index]; stringBuilder.append(stringGenerator(index,module)); value = value- module* intArr[index]; } return stringBuilder.toString(); } private static String stringGenerator(int index, int module) { String[] romanArr = {"I","IV", "V","IX", "X", "XL","L","XC", "C","CD" ,"D","CM", "M"}; String s = ""; for (int i = 0; i < module; i++) { s = s + romanArr[index]; } return s; } }
@kartikmahendrajalal56604 жыл бұрын
Thanks, bro
@רפאלבלזם-לבנון3 жыл бұрын
I love your chanel, Thank you very much for the content. About this question, the answer you gave is not correct, for example 499 in roman is "ID" but your code returns "CDXCIX".
@adolfocarrillo2482 жыл бұрын
NoUuuuuuuu, your´re wrong, He´s right🤥
@mayoorm9095 жыл бұрын
👌
@TheDheerendraJaiswal5 жыл бұрын
Hello sir, waiting for your oauth2 tutorials..
@keshavendraps5 жыл бұрын
950 should be CML or LM?
@dangels6664 жыл бұрын
CML
@joetorres49333 жыл бұрын
The first array value of units has a “ not a ".
@ameyamahadevgonal81303 жыл бұрын
At the start of the problem it looked like a mount everest but after the explanation it looked look nothing
@meenakshibhatia25375 жыл бұрын
How do you get the index as the actual digit? Index would be 0,1,2,3 and so on.
@dangels6664 жыл бұрын
Because for 0th index he is storing empty value. hence for each index correct value is picked up. if you don't store empty index at first, then you would have to fetch by array[index -1]
@snehanair22463 жыл бұрын
can u also mention the time and space complexity please?
@soumavanag50253 жыл бұрын
t(n) = o(number of digits in n)
@Mohit-il9gx3 жыл бұрын
6:10 i did 🤣
@by-Org2 жыл бұрын
why didn't you end
@NitinSinghMinVlogs3 жыл бұрын
lol this question😂😂😂
@ZhouHaibo3 жыл бұрын
Wow, but this solution is slow, just beat 20% of other solutions in Java. Maybe too many calculations in return result that slow.
@emanresplandor38784 жыл бұрын
wow we have somewhat the same solution wtf..
@ZhouHaibo3 жыл бұрын
That is O(1) time and O(1) space, you are cheating, men:)
@victorseba64104 жыл бұрын
U kinda talk a lot
@FredOooUnavailable3 жыл бұрын
Why don't you use an array of array where the first level is indexed by p = [0, 1, 2, 3] that you can use as [10**0, 10**1, 10**2, 10**3] = [1, 10, 100, 1000] ? So if you loop on p--, you can get every thing with romans[ p ][ num / 10**p ]