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
- Search
- Ice Cream Parlor
- Discussions
Ice Cream Parlor
Ice Cream Parlor
Sort by
recency
|
963 Discussions
|
Please Login in order to post a comment
Solution with time complexity O(nlogn) it's consider effcient with large Lists and there is possible to sorting one time but Iam a little bit lazy :)
**Python Solution : **
Mega easy Perl solution:
C#
result = [] for index,i in enumerate(arr): try: pos = arr.index(m-i, index+1, len(arr)) result=[index+1,pos+1] return result except ValueError: pass