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.
- Prepare
- Algorithms
- Sorting
- Closest Numbers
- Discussions
Closest Numbers
Closest Numbers
Sort by
recency
|
630 Discussions
|
Please Login in order to post a comment
This information is really helpfull for thoese who are interested in custom ecommerce development
public static List closestNumbers(List arr) { // Write your code here
Here is my c++ solution, you can watch the explanation here: https://youtu.be/-sX3IgdQ6Wg
Here is my Python solution!
vector closestNumbers(vector arr) { int n=arr.size(); vectora; sort(arr.begin(),arr.end()); int k; for(int i=0;id; for(int i=0;i