You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: 1664. Number of schemes to generate balance numbers One question daily
3
+
date: '2024.01.01 0:00'
4
+
tags:
5
+
- - Python
6
+
- - answer
7
+
- - Dynamic planning
8
+
- - One question daily
9
+
abbrlink: 1978f474
10
+
---
11
+
12
+
[1664. Number of schemes to generate balance numbers](https://leetcode.cn/problems/ways-to-make-a-fair-array/description/?orderBy=most_relevant)
13
+
14
+
# Thought:
15
+
16
+
See when you read the question medium I know that it is definitely not really going to delete an element。Otherwise it will time out,So I tried to try polepythonFeature code:Use slice to process all data;
17
+
But it's timeout。。
18
+
19
+
然后看官方answer,用的Dynamic planning。中心Thought是:
20
+
>General nature,Now we will settle down i Delete elements,
21
+
Obviously the bidding i The previous element bidding will not change from this,Bidding i
22
+
The original was originally j,j>iThe array elements of the bid will move to the bidding j−1,
23
+
Immediately bidding i The subsequent bidding elements will become the rated element,
24
+
The even bidding element will become a strange number of bidding elements。
0 commit comments