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.
- Sales by Match
- Discussions
Sales by Match
Sales by Match
Sort by
recency
|
357 Discussions
|
Please Login in order to post a comment
JAVA
we just need to go through the n elements once (if we focus on performance and maybe not so clean code). I ve used the boolean array for memory optimization too, which makes the code a bit less readable too, possibly:
`
int sockMerchant(int n, vector ar) { std::sort(ar.begin(),ar.end()); int pairs = 0;
}
`