JAVAAID community: RU-vid recently changed the way they monetize my content. My channel now needs 1,000 subscribers so it would be awesome if you could show your support by both watching my videos and subscribing to my channel if you haven’t already done so. Monetizing my videos allows me to invest back into the channel with new equipment so a small gesture from you goes a huge way for me. Many thanks for your support!
@@smahidharreddy Thanks for your compliment. Will try to make a tutorial on this on future if possible. It takes a lot of effort and time to make the good content and after that, very fewer people will watch then it does not motivate the creator at all. so currently I am focusing on the questions which most of the people tried but did not able to solve due to the right algorithm or approach. If there are too many people who want the solution for Queen attack problem will definitely make a video tutorial on this very soon. but if you need help to solve this, I can.
Does this work with "dkhc", with the logic, it will be d k h c, since d < k, we swap out c which is the smallest character to the right, now it becomes c k h d, after sorting c d h k which is wrong.
Please Explain Line 32: int firstSmallChar=charArray[endindex-1] why should we convert char to int ? Instead of do like Line 32: int firstSmallChar=endindex-1; Line 37: In 'if' condition (charArray[startindex]>charArray[firstSmallChar]) Thanks in Advance!!
I was doing the same thing but just using an extra string for return and hence HRank was giving Segmentation Fault... And I wasted 2 Hrs. in Detecting Error of Memory overload... I hope this helps... :)
I have started loving your vedios and parallelly the Hackerrank. But I was having a doubt here line37 :- Is it necessary to check charArray[startIndex]> firstSmallChar , bcz in the starting loop itself we have selected "d" which is smaller than all other so obviously value of charArray[startIndex] will be always greater than "d". Please let me understand if I misunderstood something.
hey i followed your video and did the same but still my half test cases are getting time out..i have commented my code in the discussion section in your comment thread ..please check it and tell me what im doing wrong
Hi Sterling Quinn, this is the catch here, it looks that its nlogn but it's not because sorting a string array will take O(nlogn) time but sorting a char array will take only O(n) time, you can apply counting sort for that.