๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.63K subscribers
5.61K photos
3 videos
95 files
10.6K links
๐ŸšฉMain Group - @SuperExams
๐Ÿ“Job Updates - @FresherEarth

๐Ÿ”ฐAuthentic Coding Solutions(with Outputs)
โš ๏ธDaily Job Updates
โš ๏ธHackathon Updates & Solutions

Buy ads: https://telega.io/c/cs_algo
Download Telegram
#include<bits/stdc++.h>
using namespace std;

long long m = 100000000000000000;

int minOperations(vector<int> &arr)
{
    int n=arr.size();
    if(n == 1) return 0;

    if(n == 2) return arr[0]+arr[1]<0;

    int cnt = 0;

    long long prev,curr,next;

    prev = m;
    curr = arr[0];
    next = arr[1];

    int ind = 1;

    while(ind<n)
    {  
        if(prev+curr+next<0 || curr+next<0)
        {
            prev = curr;
            curr = m;
            cnt++;
        }else{
            prev = curr;
            curr = next;
        }

        if(ind<n) next = arr[ind+1];
        ind++;
    }

    return cnt;
}


UKG โœ…
Make the Array Positive
def find_consecutive_sets(n):
    result = []
    count = 0

    for i in range(1, n//2 + 2):
        sum_ = 0
        temp = []
       
        for j in range(i, n + 1):
            sum_ += j
            temp.append(j)
           
            if sum_ == n:
                result.append(temp[:])
                count += 1
                break
            elif sum_ > n:
                break

    result.reverse()

    for seq in result:
        print(" ".join(map(str, seq)))
   
    print(count)

n = int(input())
find_consecutive_sets(n)


Deloitte โœ…
#include <bits/stdc++.h>
using namespace std;
long long getMaximumSum(vector<int>& no_adjacent, vector<int>& one_adjacent, vector<int>& both_adjacent) {
    int n = no_adjacent.size();
    vector<vector<long long>> dp(n, vector<long long>(3, 0));
    dp[0][0] = no_adjacent[0];
    dp[0][1] = one_adjacent[0];
    dp[0][2] = 0;
        for (int i = 1; i < n; ++i) {
        dp[i][0] = max({dp[i - 1][0], dp[i - 1][1], dp[i - 1][2]}) + no_adjacent[i];
        dp[i][1] = max(dp[i - 1][0], dp[i - 1][2]) + one_adjacent[i];
        dp[i][2] = dp[i - 1][1] + both_adjacent[i];
    }
   
    return max({dp[n - 1][0], dp[n - 1][1], dp[n - 1][2]});
}


Meesho โœ…
๐Ÿ‘1
def ways(total, k):
    MOD = 1000000007
    dp = [0] * (total + 1)
    dp[0] = 1
    for i in range(1, k + 1):
        for w in range(i, total + 1):
            dp[w] = (dp[w] + dp[w - i]) % MOD
    return dp[total]


Meesho โœ…
int beauty( const vector<int> &A )
{
   vector<int> B( 1 + A.size(), 0 );
   int N = A.size();
   for ( int pos = 1; pos <= N; pos++ )
   {
      auto B_old = B;
      int a = A[pos-1];      // index is (position - 1)
      for ( int length = 1; length <= pos; length++ )
      {
         B[length] = max( B_old[length-1] + ( a == length ), B_old[length] );
      }
   }

   return *max_element( B.begin(), B.end() );
}

Meesho โœ…
๐Ÿš€Trainee Cyber Security - Openings: 6

๐Ÿ” Requirements:
- Fresh B. Tech Graduates with Knowledge of Cyber Security
- Good communication skills
- Willing to Work from Office / Open to Shifts

๐Ÿ“ง Send your CV to Bhawana.Sharma@rsystems.com