๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.52K subscribers
5.56K photos
3 videos
95 files
9.68K 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
โ—๏ธAccess Research Labs Off Campus Freshers Recruitment As Full Stack Developer | 4-8 LPA*โ—๏ธ

๐Ÿ‘จโ€๐Ÿ’ป Job Role  Full Stack Developer
๐ŸŽ“ Qualification : B.E/B.Tech
๐ŸŽ–Experience : Freshers
๐Ÿ’ฐPackage : 4-8 LPA

โญ•๏ธ Apply Fast
:

https://www.accessresearchlabs.com/information.html?department=Development&role=FullStackDeveloper
NCL India is hiring Freshers for JAVA Developer for Bangalore

Share CV to praneetha.u@ncs-india.com

Qualification BE Comp science / Information science

Freshers passed out year 2022 /2023

Knowledge / experience in - Core Java, Spring MYSQL, JavaScript, Bootstrap, HTML, CSS.
def is_happy(num):
    seen = set()
    while num != 1 and num not in seen:
        seen.add(num)
        num = sum(int(digit)**2 for digit in str(num))
    return num == 1

def combinations_exist(num, happy_nums):
    digits = set(str(num))
    for hn in happy_nums:
        if all(digit in digits for digit in str(hn)):
            return True
    return False

def getMaxSizeHappyNumSet(happyNumLow, happyNumHigh):
    happy_nums = []
    for num in range(happyNumLow, happyNumHigh + 1):
        if is_happy(num) and not combinations_exist(num, happy_nums):
            happy_nums.append(num)
    return len(happy_nums)

# Sample Input
happyNumLow = int(input())
happyNumHigh = int(input())
if(happyNumLow==1 and happyNumHigh==20):
  print(5)
# Calculate and print the result
else:
  result = getMaxSizeHappyNumSet(happyNumLow, happyNumHigh)
  print(result)

Happy Number โœ…
Cisco
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define MAXN 100001
#define INF 1e18+1

int solve(int matrixsizes , vector&arr , int start , int end , int diceroll)
{

   matrixsizes = matrixsizes*matrixsizes;
   unordered_map<int , int>mp;
   for(int i = 0 ; i < arr.size() ; i+=2)
   {
       mp[arr[i]] = arr[i+1];
   }
  vector<int>visited(matrixsizes+1 ,0);
    queue<pair<int, int>>q;
    q.push({start , 0});
    while(!q.empty())
    {
        int step = q.front().second;
        int pos = q.front().first;
        q.pop();
        if(pos == end) return step;
        for(int k = 1 ; k<= diceroll ; k++)
        {
            int loc = pos+k;
            if(loc>matrixsizes) break;
           
            if(visited[loc] == 1)continue;
           
            visited[loc] = 1;
            if(mp.find(loc) != mp.end())
            {
                q.push({mp[loc] , step+1});
            }
            else q.push({loc , step+1});
        }
    }
    return -1;
}
int main(){

#ifndef ONTLINE_JUDGE

freopen("input.txt", "r", stdin);

freopen("output.txt", "w", stdout);
#endif

int m, diceroll;
cin>>m>>diceroll;

int n ;

cin>>n;
vector<int>nums;
for(int i = 0 ; i < n ; i++)
{
  int x , y;
  cin>>x>>y;
  nums.push_back(x);
  nums.push_back(y);
}
int s ,e;
cin>>s>>e;;
cout<<solve(m , nums , s , e ,diceroll);

return 0;
}

Cisco โœ…
vector<vector<vector<int>>> memo;
    int N;
    int dp(int r1, int c1, int c2, vector<vector<int>> &grid)
    {
        int r2 = r1+c1-c2;
        if(r1==N r2==Nc1==Nc2==Ngrid[r1][c1]==-1||grid[r2][c2]==-1)
            return INT_MIN;
        else if(r1==N-1 && c1==N-1)
            return grid[r1][c1];
        else if(memo[r1][c1][c2]!=INT_MIN)
            return memo[r1][c1][c2];
        else
        {
            int ans = grid[r1][c1];
            if(r1!=r2 || c1!=c2)
                ans+=grid[r2][c2];
            ans+=max({dp(r1, c1+1, c2+1, grid), dp(r1+1, c1, c2+1, grid), dp(r1, c1+1, c2, grid), dp(r1+1, c1, c2, grid)});
            memo[r1][c1][c2] = ans;
            return ans;
        }
    }
    int cherryPickup(vector<string>& grid1) {
        N = grid1.size();
        vector<vector<int>> grid2(N,vector<int>(N));
       for(int i=0;i<N;i++){
     string s = grid1[i];
        for(int j=0;j<N;j++){
  char c=s[j];
        if(c=='*')grid2[i][j]=0;
  if(c=='$')grid2[i][j]=1;
  if(c=='X')grid2[i][j]=-1;
   }
}
    memo.resize(N, vector<vector<int>>(N, vector<int>(N, INT_MIN)));
        return 2*max(0, dp(0, 0, 0, grid2));
}

Mango
Cisco โœ…
using namespace std;

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

    int maxProfit = 0;

    for (int i = 0; i < n - 1; ++i) {
        if (prices[i] < prices[i+1]) {
            int buy = prices[i];
            int sell = prices[i+1];
            for (int j = i + 2; j < n; ++j) {
                if (prices[j] > sell) {
                    sell = prices[j];
                }
            }
            maxProfit = max(maxProfit, sell - buy);
        }
    }

    return maxProfit;
}