java 2-liner, ruby 1-liner
ruby\n\ndef find_ball(g)\n  g.last.size.times.map{ g.reduce(_1){|i,r| i if i and r[i] == r[127&i+=r[i]] } or -1 }\nend\n\n\njava\n\nclass Solution {\n  public i
ruby\n```\ndef find_ball(g)\n  g.last.size.times.map{ g.reduce(_1){|i,r| i if i and r[i] == r[127&i+=r[i]] } or -1 }\nend\n```\n\njava\n```\nclass Solution {\n  public int[] findBall(int[][] g) {\n\n    return IntStream.range(0, g[0].length).map(i -> Arrays.stream(g).reduce(i,\n      (j,r) -> j>=0 && j+r[j]>=0 && j+r[j]<r.length && r[j]==r[j+=r[j]] ? j : -1, (a,b)->0) ).toArray();\n\n  }\n}\n```
['Java', 'Ruby']