We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Permuting Two Arrays
- Discussions
Permuting Two Arrays
Permuting Two Arrays
Sort by
recency
|
229 Discussions
|
Please Login in order to post a comment
java 15:
C++14
Java code {
A = A.stream().sorted((x,y)->x-y).collect(Collectors.toList()); B = B.stream().sorted((x,y)->y-x).collect(Collectors.toList()); for(int i=0;i return "YES"; }
in TS, when I write the sort method with the callback function, it works. But when i use the default parameter or call .reverse(), It doesn't work. I don't understand.
A.sort((a,b)=> a-b)[[[[[ B.sort((a,b)=> b-a)
works :D as opposed to
A.sort() B.sort().revers()
doesn't work :( Is it not the same thing??