Update appNew update is available. Click here to update.
About
Mukesh Patel School Of Technology Management & Engineering 2025
C++ - Default language
My Stats
EXP gained
yellow-spark
1946
Level
5 (Champion)
Community stats
Discussions
0
Upvotes
0
Know more
Weekend contest rating
Contest attended
Problems solved
2021 2023
Better than %
Weekend contest rating
Contest attended
Problems solved
2021 2023
Better than %
26
Total problems solved
18
Easy
8
Moderate
0
Hard
0
Ninja
Jan Jan Feb Feb Mar Mar Apr Apr May May Jun Jun Jul Jul Aug Aug Sep Sep Oct Oct Nov Nov Dec Dec

Current streak:

0 days

Longest streak:

3 days

Less

More

Achievements
2
Ronin
Topics
Arrays
Hash Table
Discussions
Test case 1 is not satisfied as per the code
Interview problems

import java.util.* ;

import java.io.*; 

public class Solution{ 

    public static int fishEater(int[] fishes) {

        int size=0;

        for(int i=0; i<fishes.length; i++) {

            size++;

        }

        // Write your code here.

        for(int j=0; j<fishes.length-1; j++) {

            if(fishes[j]>fishes[j+1]){

                size--;

            }

        }

        return size-1;

    }

}

profile
Rahul Devra
Published On 15-Sep-2023
17 views
0 replies
0 upvotes