/** * File: two_sum.kt * Created Time: 2024-01-25 * Author: curtishd (1023632660@qq.com) */ package chapter_searching /* 方法一:暴力列舉 */ fun twoSumBruteForce(nums: IntArray, target: Int): IntArray { val size = nums.size // 兩層迴圈,時間複雜度為 O(n^2) for (i in 0..() // 單層迴圈,時間複雜度為 O(n) for (i in 0..