# Help me in solving RATINGINPRAC problem

### My issue

for(int i=1;i<n;i++){
if(a[i] >= a[i-1]){
Console.WriteLine(“yes”);return;
}
}

### My code

``````using System;

public class Test
{
static void solve(){
int[] a=new int[n];
for(int i=0;i<n;i++){
}
for(int i=1;i<n;i++){
if(a[i]  >= a[i-1]){
Console.WriteLine("yes");return;
}
}
Console.WriteLine("no");
}
public static void Main()
{
while(t<0){
solve();
t--;
}

}

}

``````

Learning course: Arrays using C#
Problem Link: CodeChef: Practical coding for everyone

in python

‘’’
number_of_test_case = int(input())

for _ in range(number_of_test_case):
n = int(input())
array = list(map(int,input().split()))

``````flag = 0
for i in range(0,n-1):
if(array[i] > array[i+1]):
flag = 1
break
else:
continue

if(flag == 1):
print("No")
else:
print("Yes")
``````

‘’’

in C#
‘’’
using System;

public class Test
{

``````static void Main()
{

for (int t = 0; t < numberOfTestCases; t++)
{
int[] array = new int[n];

for (int i = 0; i < n; i++)
{
array[i] = int.Parse(arrayInput[i]);
}

int flag = 0;
for (int i = 0; i < n - 1; i++)
{
if (array[i] > array[i + 1])
{
flag = 1;
break;
}
}

if (flag == 1)
{
Console.WriteLine("No");
}
else
{
Console.WriteLine("Yes");
}
}
}
``````

}
‘’‘’

I’m willing to engage in discussions and open to considering any errors or flaws in my reasoning.