CODING SOLUTIONS | IBM | AMAZON CODING SOLUTIONS
Kanalga Telegram’da o‘tish
8 815
Obunachilar
Ma'lumot yo'q24 soatlar
-207 kun
-11730 kun
Postlar arxiv
Still who didn't get joining Letter join Discussion group and get to know👇👇
@TCS_joining_letter
@TCS_joining_letter
Python
Rohan & jack
Telegram - Share✅✅
https://t.me/coding_solutions_all
Jack code
Telegram - Share✅✅
https://t.me/coding_solutions_all
Dave automobile engineer code
Telegram - Share✅✅
https://t.me/coding_solutions_all
Telegram - Share✅✅
https://t.me/coding_solutions_all
#include <bits/stdc++.h>
using namespace std;
int main(){
string tmp="";
int x=0;
cin>>tmp;
for(auto x:tmp){
if(x>='1' && x<='9' ){
x+=(x-'0');
}
}
cout<<(x<=tmp.size()?"YES":"NO")<<endl;
}
Code in c++
CODING_SOLUTION_HELP:
TCS NQT EXAM HELP:
@)I advised him
Ans) d
@) 2020 was
Ans) no error
2) neither of the four sons
Ans) neither or nor
@)The adverse impacts
Ans) C and d
@) With the spread
Ans) QR
@) pranay
Ans) has been working
✅Telegram - @coding_solutions_all
@) the wrong term
Qkzj
Yesterday itself i said questions are different
9-12000
10-4200
11-1900,2100
14.3
17.22mins
✅Telegram @coding_solutions_all
Tcs nqt 9 am answers
1- X-5
2-14
3-8
1- X-5
2-14
3-8
4-50
✅9am TCS SLOTS SOLUTIONS GROUP
✅Telegram - @coding_solutions_all
✅Telegram - @coding_solutions_all
✅Telegram - @coding_solutions_all
✅Telegram - @coding_solutions_all
✅Telegram - @coding_solutions_all
✅Share and join all tcs 9am slot students to the group for mutual help
✅9am TCS SLOTS SOLUTIONS GROUP
✅Telegram - @coding_solution_all
✅Telegram - @coding_solution_all
✅Telegram - @coding_solution_all
✅Telegram - @coding_solution_all
✅Telegram - @coding_solution_all
✅Share and join all tcs 9am slot students to the group for mutual help
🤡TCS NQT Discussion group 👇👇 Join now🤡
@TCS_NQT_ANSWER_FREE
@TCS_NQT_ANSWER_FREE
🤡 start your registration 🤡
paid NQT Exam members
⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠Only 10 to 20% same questions will get..... That to shuffled
Important Note :
⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠
🤡 paid NQT is different questions to all 🤡
🤡Don't pay to anyone.. Who are helping in group
TCS NQT Discussion group 👇👇 Join now
@TCS_NQT_ANSWER_FREE
@TCS_NQT_ANSWER_FREE
#include <bits/stdc++.h>
#define n 3
using namespace std;
int findLongestFromACell(int i, int j, int mat[n][n], int dp[n][n])
{
if (i < 0 i >= n j < 0 || j >= n)
return 0;
if (dp[i][j] != -1)
return dp[i][j];
int x = INT_MIN, y = INT_MIN, z = INT_MIN, w = INT_MIN;
if (j < n - 1 && ((mat[i][j] + 1) == mat[i][j + 1]))
x = 1 + findLongestFromACell(i, j + 1, mat, dp);
if (j > 0 && (mat[i][j] + 1 == mat[i][j - 1]))
y = 1 + findLongestFromACell(i, j - 1, mat, dp);
if (i > 0 && (mat[i][j] + 1 == mat[i - 1][j]))
z = 1 + findLongestFromACell(i - 1, j, mat, dp);
if (i < n - 1 && (mat[i][j] + 1 == mat[i + 1][j]))
w = 1 + findLongestFromACell(i + 1, j, mat, dp);
return dp[i][j] = max({x, y, z, w, 1});
}
int LongestPath(int mat[n][n])
{
int result = 1;
int dp[n][n];
memset(dp, -1, sizeof dp);
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
if (dp[i][j] == -1)
findLongestFromACell(i, j, mat, dp);
result = max(result, dp[i][j]);
}
}
return result;
}
int main()
{
int mat[n][n] = {{1, 2, 9}, {5, 3, 8}, {4, 6, 7}};
cout << "Length of the longest path is "
<< LongestPath(mat);
return 0;
}
#include <bits/stdc++.h>
#define n 3
using namespace std;
int findLongestFromACell(int i, int j, int mat[n][n], int dp[n][n])
{
if (i < 0 i >= n j < 0 || j >= n)
return 0;
if (dp[i][j] != -1)
return dp[i][j];
int x = INT_MIN, y = INT_MIN, z = INT_MIN, w = INT_MIN;
if (j < n - 1 && ((mat[i][j] + 1) == mat[i][j + 1]))
x = 1 + findLongestFromACell(i, j + 1, mat, dp);
if (j > 0 && (mat[i][j] + 1 == mat[i][j - 1]))
y = 1 + findLongestFromACell(i, j - 1, mat, dp);
if (i > 0 && (mat[i][j] + 1 == mat[i - 1][j]))
z = 1 + findLongestFromACell(i - 1, j, mat, dp);
if (i < n - 1 && (mat[i][j] + 1 == mat[i + 1][j]))
w = 1 + findLongestFromACell(i + 1, j, mat, dp);
return dp[i][j] = max({x, y, z, w, 1});
}
int LongestPath(int mat[n][n])
{
int result = 1;
int dp[n][n];
memset(dp, -1, sizeof dp);
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
if (dp[i][j] == -1)
findLongestFromACell(i, j, mat, dp);
result = max(result, dp[i][j]);
}
}
return result;
}
int main()
{
int mat[n][n] = {{1, 2, 9}, {5, 3, 8}, {4, 6, 7}};
cout << "Length of the longest path is "
<< LongestPath(mat);
return 0;
}
