Language: Java

    import java.util.*;
    public class Main{
     	public static void main(String args[]){
        	Scanner s = new Scanner(System.in);
         	int n = s.nextInt();
          	int [] h = new int[n];
          for(int i =0;i<n;i++){
          	h[i]=s.nextInt();
          }
          int [] dp = new int [n+1];
          
          Arrays.fill(Integer.MAX_VALUE);
          dp[1]=0;
          
          
          for(int i =2;i<=n;i++){
            dp[i]=Math.min(dp[i-1]+Math.abs(h[i]-h[i-1],dp[i]));
            dp[i]=Math.min(dp[i-2]+Math.abs(h[i]-h[i-2],dp[i]));               
        }
                   return dp[n];
     
     }  
    }

Compiler output:
Main.java:12: error: no suitable method found for fill(int)
          Arrays.fill(Integer.MAX_VALUE);
                ^
    method Arrays.fill(long[],long) is not applicable
      (actual and formal argument lists differ in length)
    method Arrays.fill(long[],int,int,long) is not applicable
      (actual and formal argument lists differ in length)
    method Arrays.fill(int[],int) is not applicable
      (actual and formal argument lists differ in length)
    method Arrays.fill(int[],int,int,int) is not applicable
      (actual and formal argument lists differ in length)
    method Arrays.fill(short[],short) is not applicable
      (actual and formal argument lists differ in length)
    method Arrays.fill(short[],int,int,short) is not applicable
      (actual and formal argument lists differ in length)
    method Arrays.fill(char[],char) is not applicable
      (actual and formal argument lists differ in length)
    method Arrays.fill(char[],int,int,char) is not applicable
      (actual and formal argument lists differ in length)
    method Arrays.fill(byte[],byte) is not applicable
      (actual and formal argument lists differ in length)
    method Arrays.fill(byte[],int,int,byte) is not applicable
      (actual and formal argument lists differ in length)
    method Arrays.fill(boolean[],boolean) is not applicable
      (actual and formal argument lists differ in length)
    method Arrays.fill(boolean[],int,int,boolean) is not applicable
      (actual and formal argument lists differ in length)
    method Arrays.fill(double[],double) is not applicable
      (actual and formal argument lists differ in length)
    method Arrays.fill(double[],int,int,double) is not applicable
      (actual and formal argument lists differ in length)
    method Arrays.fill(float[],float) is not applicable
      (actual and formal argument lists differ in length)
    method Arrays.fill(float[],int,int,float) is not applicable
      (actual and formal argument lists differ in length)
    method Arrays.fill(Object[],Object) is not applicable
      (actual and formal argument lists differ in length)
    method Arrays.fill(Object[],int,int,Object) is not applicable
      (actual and formal argument lists differ in length)
Main.java:17: error: no suitable method found for abs(int,int)
            dp[i]=Math.min(dp[i-1]+Math.abs(h[i]-h[i-1],dp[i]));
                                       ^
    method Math.abs(int) is not applicable
      (actual and formal argument lists differ in length)
    method Math.abs(long) is not applicable
      (actual and formal argument lists differ in length)
    method Math.abs(float) is not applicable
      (actual and formal argument lists differ in length)
    method Math.abs(double) is not applicable
      (actual and formal argument lists differ in length)
Main.java:18: error: no suitable method found for abs(int,int)
            dp[i]=Math.min(dp[i-2]+Math.abs(h[i]-h[i-2],dp[i]));               
                                       ^
    method Math.abs(int) is not applicable
      (actual and formal argument lists differ in length)
    method Math.abs(long) is not applicable
      (actual and formal argument lists differ in length)
    method Math.abs(float) is not applicable
      (actual and formal argument lists differ in length)
    method Math.abs(double) is not applicable
      (actual and formal argument lists differ in length)
Main.java:20: error: incompatible types: unexpected return value
                   return dp[n];
                            ^
4 errors