โ
โ
โ
#HackerEarth Farthest From Zero - HackerEarth Java Solution
https://csalgo.tech/threads/farthest-from-zero-hackerearth-java-solution.270/
https://csalgo.tech/threads/farthest-from-zero-hackerearth-java-solution.270/
CS-Algo
HackerEarth - Farthest From Zero - HackerEarth Java Solution
Farthest From Zero - HackerEarth Java Solution
(Hidden text: Visit the forum thread!)
Farthest From Zero - HackerEarth Java Solution
(Hidden text: Visit the forum thread!)
Farthest From Zero - HackerEarth Java Solution
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Adobe is hiring
Role: Member of Technical Staff
Eligible batch: Only 2022 passouts
CTC: 26+ LPA
Apply Link: https://forms.office.com/Pages/ResponsePage.aspx?id=Wht7-jR7h0OUrtLBeN7O4YZ2zwmoRh1Pg8bkvwiS15BURU9CSlVYMlZKNVhCVTVXSlRGMVJQSVBYUS4u
If interested, apply right now.
Role: Member of Technical Staff
Eligible batch: Only 2022 passouts
CTC: 26+ LPA
Apply Link: https://forms.office.com/Pages/ResponsePage.aspx?id=Wht7-jR7h0OUrtLBeN7O4YZ2zwmoRh1Pg8bkvwiS15BURU9CSlVYMlZKNVhCVTVXSlRGMVJQSVBYUS4u
If interested, apply right now.
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
2017. Grid Game
You are given a 0-indexed 2D array grid of size 2 x n, where grid[r][c] represents the number of points at position (r, c) on the matrix. Two robots are playing a game on this matrix.
Both robots initially start at (0, 0) and want to reach (1, n-1). Each robot may only move to the right ((r, c) to (r, c + 1)) or down ((r, c) to (r + 1, c)).
At the start of the game, the first robot moves from (0, 0) to (1, n-1), collecting all the points from the cells on its path. For all cells (r, c) traversed on the path, grid[r][c] is set to 0. Then, the second robot moves from (0, 0) to (1, n-1), collecting the points on its path. Note that their paths may intersect with one another.
The first robot wants to minimize the number of points collected by the second robot. In contrast, the second robot wants to maximize the number of points it collects. If both robots play optimally, return the number of points collected by the second robot.
Input: grid = [[2,5,4],[1,5,1]]
Output: 4
Explanation: The optimal path taken by the first robot is shown in red, and the optimal path taken by the second robot is shown in blue.
The cells visited by the first robot are set to 0.
The second robot will collect 0 + 0 + 4 + 0 = 4 points.
class Solution {
public:
long long gridGame(vector<vector<int>>& grid) {
int n=grid[0].size();
long long f=0,s=0,res=LONG_MAX;
for(auto& i:grid[0])f+=i;
for(int i=0;i<n;i++){
f-=grid[0][i];
res=min(res,max(f,s));
s+=grid[1][i];
}
return res;
}
};
// TC O(N)
// SC O(1)
Amazon SDE1 (T1 interview question asked)
You are given a 0-indexed 2D array grid of size 2 x n, where grid[r][c] represents the number of points at position (r, c) on the matrix. Two robots are playing a game on this matrix.
Both robots initially start at (0, 0) and want to reach (1, n-1). Each robot may only move to the right ((r, c) to (r, c + 1)) or down ((r, c) to (r + 1, c)).
At the start of the game, the first robot moves from (0, 0) to (1, n-1), collecting all the points from the cells on its path. For all cells (r, c) traversed on the path, grid[r][c] is set to 0. Then, the second robot moves from (0, 0) to (1, n-1), collecting the points on its path. Note that their paths may intersect with one another.
The first robot wants to minimize the number of points collected by the second robot. In contrast, the second robot wants to maximize the number of points it collects. If both robots play optimally, return the number of points collected by the second robot.
Input: grid = [[2,5,4],[1,5,1]]
Output: 4
Explanation: The optimal path taken by the first robot is shown in red, and the optimal path taken by the second robot is shown in blue.
The cells visited by the first robot are set to 0.
The second robot will collect 0 + 0 + 4 + 0 = 4 points.
class Solution {
public:
long long gridGame(vector<vector<int>>& grid) {
int n=grid[0].size();
long long f=0,s=0,res=LONG_MAX;
for(auto& i:grid[0])f+=i;
for(int i=0;i<n;i++){
f-=grid[0][i];
res=min(res,max(f,s));
s+=grid[1][i];
}
return res;
}
};
// TC O(N)
// SC O(1)
Amazon SDE1 (T1 interview question asked)
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Transpose Matrix
Given a 2D integer array matrix, return the transpose of matrix.
The transpose of a matrix is the matrix flipped over its main diagonal, switching the matrix's row and column indices.
Example 1:
Input: matrix = [[1,2,3],[4,5,6],[7,8,9]]
Output: [[1,4,7],[2,5,8],[3,6,9]]
Example 2:
Input: matrix = [[1,2,3],[4,5,6]]
Output: [[1,4],[2,5],[3,6]]
class Solution {
public:
vector<vector<int>> transpose(vector<vector<int>>& matrix) {
vector<vector<int>> ans;
for(int i=0;i<matrix[0].size();i++)
{
vector<int>temp;
for(int j=0;j<matrix.size();j++)
{
temp.push_back(matrix[j][i]);
}
ans.push_back(temp);
}
return ans;
}
};
// TC O(N*M)
// SC O(N*M)
Amazon SDE1 (T1 interview question asked)
Given a 2D integer array matrix, return the transpose of matrix.
The transpose of a matrix is the matrix flipped over its main diagonal, switching the matrix's row and column indices.
Example 1:
Input: matrix = [[1,2,3],[4,5,6],[7,8,9]]
Output: [[1,4,7],[2,5,8],[3,6,9]]
Example 2:
Input: matrix = [[1,2,3],[4,5,6]]
Output: [[1,4],[2,5],[3,6]]
class Solution {
public:
vector<vector<int>> transpose(vector<vector<int>>& matrix) {
vector<vector<int>> ans;
for(int i=0;i<matrix[0].size();i++)
{
vector<int>temp;
for(int j=0;j<matrix.size();j++)
{
temp.push_back(matrix[j][i]);
}
ans.push_back(temp);
}
return ans;
}
};
// TC O(N*M)
// SC O(N*M)
Amazon SDE1 (T1 interview question asked)
KPIT โ
(Python 3)
๐
๐๐๐ฅ๐ข๐ง๐ ๐ฐ๐ก๐๐ง ๐ฒ๐จ๐ฎ ๐๐จ๐ฆ๐ฉ๐ฅ๐๐ญ๐๐ ๐๐ฅ๐ฅ ๐ญ๐ก๐ ๐ญ๐๐ฌ๐ค๐ฌ ๐๐ง๐ ๐ฆ๐๐ซ๐ค ๐ญ๐ก๐๐ฆ โ
, ๐ข๐ญ'๐ฌ ๐ฎ๐ง๐ฆ๐๐ญ๐๐ก๐๐ ๐โค๏ธ
P.S. Start creating a list of task which you want to do on any particular day, trust me it will increase your productivity and help you being consistent โ
P.S. Start creating a list of task which you want to do on any particular day, trust me it will increase your productivity and help you being consistent โ
๐3
// First Unique Character
// TC O(N)
// SP O(N)
int Xexamster(string str)
{
int count = 0;
unordered_map<char, int> mp;
for (int i = 0; i < str.length(); i++)
mp[str[i]]++;
for (auto i : mp)
{
if (i.second == 1)
count++;
}
return count;
}
// TC O(N)
// SP O(N)
int Xexamster(string str)
{
int count = 0;
unordered_map<char, int> mp;
for (int i = 0; i < str.length(); i++)
mp[str[i]]++;
for (auto i : mp)
{
if (i.second == 1)
count++;
}
return count;
}
โ
โ
โ
#HackerRank EV Positive Prefixes - HackerRank Python Solutions
https://csalgo.tech/threads/ev-positive-prefixes-hackerrank-python-solutions.261/
https://csalgo.tech/threads/ev-positive-prefixes-hackerrank-python-solutions.261/
CS-Algo
HackerRank - EV Positive Prefixes - HackerRank Python Solutions
EV Positive Prefixes - HackerRank Python Solutions
Python 3 - Code
(Hidden text: Visit the forum thread!)
EV Positive Prefixes - HackerRank Python Solutions
Python 3 - Code
(Hidden text: Visit the forum thread!)
EV Positive Prefixes - HackerRank Python Solutions
๐1
โ
โ
โ
#HackerRank EV_First Unique Character - HackerRank C++ Solution
https://csalgo.tech/threads/ev_first-unique-character-hackerrank-c-solution.271/
https://csalgo.tech/threads/ev_first-unique-character-hackerrank-c-solution.271/
CS-Algo
HackerRank - EV_First Unique Character - HackerRank C++ Solution
First Unique Character - HackerRank C++ Solution
(Hidden text: Visit the forum thread!)
First Unique Character - HackerRank C++ Solution
(Hidden text: Visit the forum thread!)
First Unique Character - HackerRank C++ Solution
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Flipkart GRID 4.0 (The most awaited opportunity)
Batch eligible: 2023, 2024, 2025 and 2026 passouts
Great opportunity to start career with Flipkart โค๏ธโ
https://bit.ly/3GMY5ZM
Share Among juniors, friends and seniors and also hit a โค๏ธ so that it will reach to max๐โ
Batch eligible: 2023, 2024, 2025 and 2026 passouts
Great opportunity to start career with Flipkart โค๏ธโ
https://bit.ly/3GMY5ZM
Share Among juniors, friends and seniors and also hit a โค๏ธ so that it will reach to max๐โ
Unstop
Flipkart GRiD 4.0 - Software Development Challenge by Flipkart! | 2022 // Unstop (formerly Dare2Compete)
Flipkart GRiD 4.0 - Software Development Challenge a hackathons by Flipkart open to Engineering Students, Postgraduate, Undergraduate Apply online before 2022-07-01 10:00:34! | 2022
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
GeeksForGeeks is hiring Technical Content Engineer Intern.
If you are looking for same in any of the below roles, send your resume at divyanshu.kumar@geeksforgeeks.org
All batch Eligible.
If you are looking for same in any of the below roles, send your resume at divyanshu.kumar@geeksforgeeks.org
All batch Eligible.
๐ Adobe Off Campus Drive 2022 : Mass Hiring for Freshers With 26 LPA
* Designation : Member of Technical Staff
* Eligibility : B.E/B.Tech/M.E/M.Tech
* Batch : 2021 , 2022
* Job Location : Bangalore
* Experience : Freshers
* Salary : Rs 26 LPA
Apply Here
โ Share in ur College WhatsApp Groups
๐Direct & 100% Ads Free Links
Telegram - t.me/fresherearth
* Designation : Member of Technical Staff
* Eligibility : B.E/B.Tech/M.E/M.Tech
* Batch : 2021 , 2022
* Job Location : Bangalore
* Experience : Freshers
* Salary : Rs 26 LPA
Apply Here
โ Share in ur College WhatsApp Groups
๐Direct & 100% Ads Free Links
Telegram - t.me/fresherearth
๐2
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ pinned ยซ๐ Adobe Off Campus Drive 2022 : Mass Hiring for Freshers With 26 LPA * Designation : Member of Technical Staff * Eligibility : B.E/B.Tech/M.E/M.Tech * Batch : 2021 , 2022 * Job Location : Bangalore * Experience : Freshers * Salary : Rs 26 LPA Apply Hereโฆยป