回答編集履歴

1

2023/12/10 01:25

投稿

melian
melian

スコア19865

test CHANGED
@@ -1,6 +1,9 @@
1
1
  ```julia
2
2
  input = [[1,2,3], [3,4,5,6]]
3
+ # lastindex
4
+ output = getindex.(input, lastindex.(input).-1)
5
+ # comprehension
3
- output = [row[end-1] for row in input]
6
+ # output = [row[end-1] for row in input]
4
7
  print(output)
5
8
 
6
9
  # [2, 5]