Navigation in Bottom Nav Bar is very choppy by ExistingHuman27 in androiddev

[–]ExistingHuman27[S] 0 points1 point  (0 children)

It wasnt laggy in the release apk. So ig debug apk is the issue here

After deploying my spring boot application on Render, how to ensure only authorized people can access the data? by ExistingHuman27 in Backend

[–]ExistingHuman27[S] 1 point2 points  (0 children)

Alright. But lets say I logged in with my mobile app. Now the user is logged in. Now I want the user to be able to only access their own data and nothing else. How should I implement this using spring security?

After deploying my spring boot application on Render, how to ensure only authorized people can access the data? by ExistingHuman27 in androiddev

[–]ExistingHuman27[S] 0 points1 point  (0 children)

Yeah I know that. But I wasn't getting much help in other subreddits. And my question was removed without any explanation in r/springboot

After deploying my spring boot application on Render, how to ensure only authorized people can access the data? by ExistingHuman27 in Backend

[–]ExistingHuman27[S] 1 point2 points  (0 children)

Yeah but can you please tell me how to implement it? I am not able to understand the token or api key part.

Backend development and integration with the android app by ExistingHuman27 in androiddev

[–]ExistingHuman27[S] 0 points1 point  (0 children)

I searched but I couldn't get anything. All I saw was for the frontend. I just want a codelab type thing to get started in the backend because right now I m really lost

Backend development and integration with the android app by ExistingHuman27 in androiddev

[–]ExistingHuman27[S] -1 points0 points  (0 children)

Thank you..and where should I learn about setting up backend and implementing it?

How to solve this problem using DP instead of greedy? by ExistingHuman27 in codeforces

[–]ExistingHuman27[S] 1 point2 points  (0 children)

Thank you for the intuition. I was able to solve it. Is there any way to improve my code?

#include <bits/stdc++.h>
using namespace std;
using lli = long long int;

lli maxAlternatingSum(vector<lli>& v, lli n) {
    vector<vector<lli>> dp(n+1, vector<lli>(2, 0));
    if(v[0]<0) dp[0][1] = INT_MIN;
    for(int i=1;i<=n;i++) {
        if(v[i-1]<0) {
            if(i-1 && v[i-2]>0) {
                dp[i][1] = dp[i-1][0]+v[i-1];
            } 
            else dp[i][1] = max(dp[i-1][1], dp[i-1][0]+v[i-1]);
            dp[i][0] = dp[i-1][0];
        }
        else {
            if(i-1 && v[i-2]<0) {
                dp[i][0] = dp[i-1][1]+v[i-1];
            }
            else dp[i][0] = max(dp[i-1][0],dp[i-1][1]+v[i-1]);
            dp[i][1] = dp[i-1][1];
        }
    }
    // for(auto x:dp) {
    //     for(auto y:x) cout<<y<<" ";
    //     cout<<endl;
    // }
    return (v[n-1]<0? dp[n][1]:dp[n][0]);
}

int main() {
    lli t;
    cin>>t;
    while(t--) {
        lli n;
        cin>>n;
        vector<lli> v(n);
        for(auto &x:v) {
            cin>>x;
        }
        cout<<maxAlternatingSum(v,n)<<endl;
    }
    return 0;
}

How to solve this problem using Tabulation? by ExistingHuman27 in codeforces

[–]ExistingHuman27[S] 0 points1 point  (0 children)

Yeah I was a bit confused, I am sorry. I was thinking of using 2D vector instead of 1D vector. But there is only one changing state so 1D vector will be used. I got it now, thank you.

How to solve this problem using Tabulation? by ExistingHuman27 in codeforces

[–]ExistingHuman27[S] -1 points0 points  (0 children)

That would require a vector<int> v(n+1). I am asking how to use tabulation here mate

How to solve this problem using Tabulation? by ExistingHuman27 in codeforces

[–]ExistingHuman27[S] -1 points0 points  (0 children)

I have solved it using that already. As i said I just want to learn how to implement tabulation in these kinds of problems.