WhiteHat Coding
Kanalga Telegram’da o‘tish
Sharing = caring = spreading happiness
Ko'proq ko'rsatish650
Obunachilar
Ma'lumot yo'q24 soatlar
-27 kunlar
-330 kunlar
Postlar arxiv
Guy's
Accenture is sending Task Mails for students who completed their interview between July- Aug
Please check your inbox and spam section also😊👍
class Solution
{
public:
#define ll long long
ll dp[1001][1001];
#define vvi vector<vector<ll>>
ll helper(ll i, ll j, vector<int> &arr, vvi &dp2){
if(i > j) return 0;
if(dp2[i][j] != -1) return dp2[i][j];
ll ans = helper(i+ 1, j, arr, dp2) + (ll)arr[i] * (j - i + 1) + (dp[i][j]);
ans = max(ans, helper(i, j-1, arr, dp2) + (ll)arr[j] * (j - i + 1) + (dp[i][j]));
return dp2[i][j] = ans;
}
long long MaxScore(int n, vector<int>&arr)
{
for(int i = 0; i < n; i++){
dp[i][i] = arr[i];
for(int j = i + 1; j < n; j++){
dp[i][j] = min((ll)arr[j], dp[i][j-1]);
}
}
ll ans = 0;
vvi dp2(n, vector<ll>(n, -1));
return helper(0, n - 1, arr, dp2);
}
};
Keep Sharing guys!! ❤️😊
For Free Solutions.
More Members -> More Solutions!!
Share @Whitehatcoding ❤️
https://instagram.com/ezsnippet?igshid=MzRlODBiNWFlZA==
Check out the videos guys
You'll definitely learn new things from this
👉👉 Hello Guy's ❤️,
hope you are doing well and everything is going well 😊
As you might have noticed, I've been a bit offline 😅 and that's because I have some exciting news to share with all of you: I'm going to the USA! ✈️✈️ It's been my dream to Study there, and I'm thrilled that it's finally happening 😍
Not sure how many students have texted us in person and in groups, but we have something special planned for you all😉(kindly don’t dm us immediately after reading this message)
Will be sharing the details of what we were planning to work on tomorrow.
You can contact us after we share all the details here 🤩✌️
Stay tuned 📻📻
Coding_000 ❤️
preceding text or remark CODE ❤️👇
Language python 3
def greatest_divisible_by_90(cards):
count_zeroes = cards.count(0)
count_fives = cards.count(5)
if count_zeroes == 0:
return "0"
if count_fives == 0:
return "0"
if count_fives < 2 or sum(cards) % 9 != 0:
return "-1"
num_fives = count_fives // 2 *2
num_zeroes = count_zeroes
result = "5" * num_fives + "0" * num_zeroes
return result
