File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -29,20 +29,18 @@ public func run_ArraySubscript(_ N: Int) {
29
29
func bound( _ x: Int ) -> Int { return min ( x, numArrayElements- 1 ) }
30
30
31
31
for _ in 1 ... N {
32
-
33
- var arrays = [ [ Int ] ] ( repeating : [ ] , count : numArrays)
34
- for i in 0 ..< numArrays {
35
- for _ in 0 ..< numArrayElements {
36
- arrays [ i ] . append ( Int ( truncatingIfNeeded : Random ( ) ) )
32
+ var arrays = [ [ Int ] ] ( repeating : [ ] , count : numArrays )
33
+ for i in 0 ..< numArrays {
34
+ for _ in 0 ..< numArrayElements {
35
+ arrays [ i ] . append ( Int ( truncatingIfNeeded : Random ( ) ) )
36
+ }
37
37
}
38
- }
39
-
40
- // Do a max up the diagonal.
41
- for i in 1 ..< numArrays {
42
- arrays [ i] [ bound ( i) ] =
43
- max ( arrays [ i- 1 ] [ bound ( i- 1 ) ] , arrays [ i] [ bound ( i) ] )
44
- }
45
- CheckResults ( arrays [ 0 ] [ 0 ] <= arrays [ numArrays- 1 ] [ bound ( numArrays- 1 ) ] )
46
38
39
+ // Do a max up the diagonal.
40
+ for i in 1 ..< numArrays {
41
+ arrays [ i] [ bound ( i) ] =
42
+ max ( arrays [ i- 1 ] [ bound ( i- 1 ) ] , arrays [ i] [ bound ( i) ] )
43
+ }
44
+ CheckResults ( arrays [ 0 ] [ 0 ] <= arrays [ numArrays- 1 ] [ bound ( numArrays- 1 ) ] )
47
45
}
48
46
}
You can’t perform that action at this time.
0 commit comments