一.有效的三角形个数
有效的三角形个数
class Solution {public int triangleNumber(int[] nums) {Arrays.sort(nums);int i0,end nums.length-1;int count 0;for( i end;i>2;i--){int left 0;int right i-1;while(left<right){if(nums[left]nums[right]>nums…
一、AKF的核心思想
AKF架构设计的核心思想源于对系统可扩展性、可用性和灵活性的深刻理解。AKF(Availability, Scalability, Flexibility)架构模型由Martin L. Abbott和Michael T. Fisher在《The Art of Scalability》一书中提出,旨在帮助工…
题目: 题解:
type point struct{x, y int
}var dirs []point{{-1, 0}, {1, 0}, {0, -1}, {0, 1}}func updateMatrix(mat [][]int) [][]int {var m, n len(mat), len(mat[0])var res make([][]int, m)var visited make([][]bool, m)var queue []poin…
题目: 题解:
const mod int 1e9 7type matrix [6][6]intfunc (a matrix) mul(b matrix) matrix {c : matrix{}for i, row : range a {for j : range b[0] {for k, v : range row {c[i][j] (c[i][j] v*b[k][j]) % mod}}}return c
}func (a matrix) p…