加载中...
import java.util.*; public class Solution { /** * max water * @param arr int整型一维数组 the array * @return long长整型 */ public long maxWater (int[] arr) { // write code here } }
class Solution { public: /** * max water * @param arr int整型vector the array * @return long长整型 */ long long maxWater(vector
& arr) { // write code here } };
# # max water # @param arr int整型一维数组 the array # @return long长整型 # class Solution: def maxWater(self , arr ): # write code here
using System; using System.Collections.Generic; class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * max water * @param arr int整型一维数组 the array * @return long长整型 */ public long maxWater (List
arr) { // write code here } }
/** * max water * @param arr int整型一维数组 the array * @return long长整型 */ function maxWater( arr ) { // write code here } module.exports = { maxWater : maxWater };
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # max water # @param arr int整型一维数组 the array # @return long长整型 # class Solution: def maxWater(self , arr: List[int]) -> int: # write code here
package main /** * max water * @param arr int整型一维数组 the array * @return long长整型 */ func maxWater( arr []int ) int64 { // write code here }
/** * max water * @param arr int整型一维数组 the array * @param arrLen int arr数组长度 * @return long长整型 */ long long maxWater(int* arr, int arrLen ) { // write code here }
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # max water # @param arr int整型一维数组 the array # @return long长整型 # class Solution def maxWater(arr) # write code here end end
object Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * max water * @param arr int整型一维数组 the array * @return long长整型 */ def maxWater(arr: Array[Int]): Long = { // write code here } }
object Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * max water * @param arr int整型一维数组 the array * @return long长整型 */ fun maxWater(arr: IntArray): Long { // write code here } }
import java.util.*; public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * max water * @param arr int整型一维数组 the array * @return long长整型 */ public long maxWater (int[] arr) { // write code here } }
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * max water * @param arr int整型一维数组 the array * @return long长整型 */ export function maxWater(arr: number[]): number { // write code here }
public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * max water * @param arr int整型一维数组 the array * @return long长整型 */ func maxWater ( _ arr: [Int]) -> Int64 { // write code here } }
struct Solution{ } impl Solution { fn new() -> Self { Solution{} } /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * max water * @param arr int整型一维数组 the array * @return long长整型 */ pub fn maxWater(&self, arr: Vec
) -> i64 { // write code here } }
[3,1,2,5,2,4]
5
[4,5,1,3,2]
2