I think we can also use a Heurestic to be even faster, like A* algo, H will be number of misplaced tiles. This seems similar to puzzle solving problem in AI course.
@AdityaMaurya-uy2yj4 күн бұрын
My concern is about swapping with zeroes. Let's say 0 is at (1,2) and my matrix is {{4,2,3},{1,5,0}} in this case if started i will look for zeroes index and swap with all around.I think in answer i will be getting moves including swaps of zeroes and by observation we can see 4,1 swap will can give potential target.
@satguy84815 күн бұрын
Nice Explaination I would be glad if you introduce some course with solving hard question only
@Prakhar2-v7u5 күн бұрын
great way of explaining
@ShubhamSharma-sf8wk5 күн бұрын
Great explanation
@piyushgupta89205 күн бұрын
Great Explanation Bro! btw is that ipad you use?
@italk-gj5kk5 күн бұрын
could you bring a one shot course for java for those who want to shift from c++
@noobnessmee5 күн бұрын
just solve problems by converting from gpt and learn syntax. Its much faster.
@sundaramagnihotri58965 күн бұрын
Bro why are you converting a Matrix into string ?
@yashmalviya01495 күн бұрын
Because it becomes costly to track a matrix
@sunshine-un1rk5 күн бұрын
8:06 Arrays cannot be used as key for visited right so converting the matrix as string we can check if the pattern is already visited or not...
@yashmalviya01495 күн бұрын
@@sunshine-un1rk we can by using a custom hash function, as Aryan said it's difficult to get a good hash so we use strings
@sunshine-un1rk5 күн бұрын
@@yashmalviya0149 yeah ok..😅
@naturesrevolution5 күн бұрын
@@yashmalviya0149ok another question why we use while(size-- >0) ? Because while(!q.isEmpty()) itself will do bfs level wise.. then why while(size-- >0) ?
@Zomb-zj4ip5 күн бұрын
broski ur entire audience watches you because theyve been coding in cpp, if you suddenly change to java thats not gonna work out for us :/
@arunm6195 күн бұрын
Broski fellow cpp dev here. People who code in Java usually find the intricacies of cpp difficult. But for us it's the otherway round right? We will try to translate to cpp.
@arunm6195 күн бұрын
Also, let's make AI our companion here, shall we?
@bishwashkumarsah1715 күн бұрын
man i do in python still i watch his videos.
@ayaaniqbal35315 күн бұрын
If you are having problem with language then you are not ready to solve these problems because for solving we only need to understand the concept and then implement it our language.