@@ -0,0 +1,1257 @@
+//https://www.hackerrank.com/contests/projecteuler/challenges/euler018%0Aimport java.io.*;%0A%0Apublic class Solution %7B%0A  public static void main(String%5B%5D args) throws IOException %7B%0A    StringBuffer sb = new StringBuffer();%0A    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));%0A    %0A    //For each test case%0A    for(byte T = Byte.parseByte(br.readLine()); T %3E 0; --T)%7B%0A        %0A      //Get triangle%0A      final byte N = Byte.parseByte(br.readLine());%0A      final byte%5B%5D%5B%5D triangle = new byte%5BN%5D%5B%5D;%0A      for(byte n = 0; n %3C N; ++n)%7B%0A        byte i = 0;%0A        triangle%5Bn%5D = new byte%5Bn+1%5D;%0A        for(String s : br.readLine().split(%22 %22))%7B%0A          triangle%5Bn%5D%5Bi++%5D = Byte.parseByte(s);%0A        %7D%0A      %7D%0A      %0A      //Initialize max sums to last row%0A      final int%5B%5D sums = new int%5BN%5D;%0A      for(int i = 0, n = N - 1; i %3C= n; ++i)%7B%0A        sums%5Bi%5D = triangle%5Bn%5D%5Bi%5D;%0A      %7D%0A      %0A      //Get max sums from bottom to top of triangle%0A      for(int y = N - 2; y %3E= 0; --y)%7B%0A        for(int x = 0; x %3C= y; ++x)%7B%0A          sums%5Bx%5D = triangle%5By%5D%5Bx%5D + Math.max(sums%5Bx%5D, sums%5Bx+1%5D);%0A        %7D%0A      %7D%0A      %0A      //Output max sum%0A      sb.append(String.format(%22%25d%5Cn%22, sums%5B0%5D));%0A    %7D%0A    %0A    //Print output%0A    System.out.print(sb);%0A  %7D%0A%7D%0A

Create euler018.java