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
- Implementation
- Larry's Array
- Discussions
Larry's Array
Larry's Array
Sort by
recency
|
355 Discussions
|
Please Login in order to post a comment
Using Python :
def larrysArray(A): # Write your code here c=0 for i in range(0,len(A)-1): for j in range(i,len(A)): if(A[i]>A[j]): c+=1 if(c%2==0): return "YES" else: return "NO"
my answer in Typescript
string larrysArray(vector A) { int counter =0; for(int i=0;iA[j]){ counter++; } } } return (counter%2==0) ? "YES" : "NO"; } jinx manga
string larrysArray(vector A) { int counter =0; for(int i=0;iA[j]){ counter++; } } } return (counter%2==0) ? "YES" : "NO"; }
Here is my c++ solution