public static int getMinSteps(int[] arr){
        int len = arr.length;
        int speed = 1;
        int i = 0;
        int step = 0;
        while(i < len){
            if(i + speed + 1>= len){
                step++;
                return step;
            }else{
                speed += arr[i + speed + 1] == 1 ? 1 : 0;
                i += speed;
                step++;
            }
        }
        return step;
    }