Code With Virus
9.37K subscribers
1.39K photos
2 videos
10 files
679 links
Coding channel @codewithvirus. πŸ‘ˆ

Main group @avirustech πŸ‘ˆ

Accenture @Accenturavirustech πŸ‘ˆ

IBM. @IBMavirustech πŸ‘ˆ

Tech Mahindra. @TechMavirustech πŸ‘ˆ
Download Telegram
Who have Infosys SP and DSP roll exam ??

And what's your exam time??

https://bit.ly/codewithanusha

https://bit.ly/infosys-SP-DSP
πŸ‘1
// Infosys
//Given Array A having N integers and divisor K
int morethanNbyK(vector<int> arr, int n, int k)
{
    int x = n / k;
    int ans = 0;
    unordered_map<int, int> freq;
    for (auto i : arr)
        freq[i]++;
    for (auto i : freq)
    {
        if (i.second > x)
        {
            ans += i.first;
        }
    }
    return ans;
}
// @codewithvirus
// @codewithvirus
// @codewithvirus
// @codewithvirus

https://bit.ly/infosys-SP-DSP
// Infosys
// N flowers on a Recatangular pana
int ans = 100000000;
void solve(vector<int> a, int n, int k, int index, int sum,
           int maxsum)
{
    if (k == 1)
    {
        maxsum = max(maxsum, sum);
        sum = 0;
        for (int i = index; i < n; i++)
        {
            sum += a[i];
        }
        maxsum = max(maxsum, sum);
        ans = min(ans, maxsum);
        return;
    }
    sum = 0;
    for (int i = index; i < n; i++)
    {
        sum += a[i];
        maxsum = max(maxsum, sum);
        solve(a, n, k - 1, i + 1, sum, maxsum);
    }
}
int GetMaxBeauty(int N, int K, vector<int> A)
{

    solve(A, N, K, 0, 0, 0);
    return ans;
}

// @codewithvirus
// @codewithvirus
// @codewithvirus
// @codewithvirus

https://bit.ly/infosys-SP-DSP
πŸ‘3
Infosys
C++ language
@codewithvirus

You are given a string S of length N. You can erase any substring of S of size <N. You need to return the lexicographically smallest remaining string after erasing a substring of S.

https://bit.ly/infosys-SP-DSP
πŸ‘2
You are given a pair of string A and B of length N
Infosys
@codewithvirus

https://bit.ly/infosys-SP-DSP
πŸ‘2