#include <iostream>
#include <string>
using namespace std;
string runLengthEncoding(const string& input) {
if (input.empty()) return "";
string result = "";
int n = input.size();
int count = 1;
for (int i = 1; i < n; ++i) {
if (input[i] == input[i - 1]) {
count++;
} else {
result += to_string(count) + input[i - 1];
count = 1;
}
}
result += to_string(count) + input[n - 1];
return result;
}
Cohesity โ
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
using namespace std;
void generatePermutations(string &s, int index, set<string> &result) {
if (index == s.size()) {
result.insert(s);
return;
}
for (int i = index; i < s.size(); ++i) {
swap(s[index], s[i]);
generatePermutations(s, index + 1, result);
swap(s[index], s[i]);
}
}
vector<string> solve(string s) {
if (s.length() < 0 || s.length() > 5 || !all_of(s.begin(), s.end(), ::islower)) {
return {};
}
set<string> result;
sort(s.begin(), s.end());
generatePermutations(s, 0, result);
vector<string> resultVector(result.begin(), result.end());
return resultVector;
}
Cohesity โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Rubrik
Role: Software Engineer Intern
Batch eligible: 2025 grads
Apply: https://www.rubrik.com/company/careers/departments/job.6195381?gh_jid=6195381&gh_src=2e352a8a1us
They reposted this job, do apply in case you are interested!!
Role: Software Engineer Intern
Batch eligible: 2025 grads
Apply: https://www.rubrik.com/company/careers/departments/job.6195381?gh_jid=6195381&gh_src=2e352a8a1us
They reposted this job, do apply in case you are interested!!
Rubrik
Error
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Zeotap
Role: Software Engineer - Backend
YOE: 0-1 years
Apply: https://jobs.lever.co/zeotap/98499d3c-a579-449b-8ef5-254d4934964f
Role: Software Engineer - Backend
YOE: 0-1 years
Apply: https://jobs.lever.co/zeotap/98499d3c-a579-449b-8ef5-254d4934964f
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int digitSum(int num) {
int sum = 0;
while (num > 0) {
sum += num % 10;
num /= 10;
}
return sum;
}
string findBingoNumbers(const vector<int>& numbers) {
vector<int> v;
for (int num : numbers) {
if (digitSum(num) <= 15) {
v.push_back(num);
if (v.size() == 2) break;
}
}
if (v.size() == 2) {
return to_string(v[0]) + " " + to_string(v[1]);
} else {
return "Bingo numbers not found";
}
}
Thoughtwork โ
#include <vector>
#include <string>
using namespace std;
int digitSum(int num) {
int sum = 0;
while (num > 0) {
sum += num % 10;
num /= 10;
}
return sum;
}
string findBingoNumbers(const vector<int>& numbers) {
vector<int> v;
for (int num : numbers) {
if (digitSum(num) <= 15) {
v.push_back(num);
if (v.size() == 2) break;
}
}
if (v.size() == 2) {
return to_string(v[0]) + " " + to_string(v[1]);
} else {
return "Bingo numbers not found";
}
}
Thoughtwork โ
def solve(rectangles):
covered = set()
for width, height in rectangles:
for x in range(width):
for y in range(height):
covered.add((x, y))
return len(covered)
def main():
n = int(input())
rectangles = []
for _ in range(n):
width, height = map(int, input().split())
rectangles.append((width, height))
result = solve(rectangles)
print(result)
if __name__ == "__main__":
main()
NLA Deloitte โ
int bintoint(string& binaryStr) {
int integer = 0;
int length = binaryStr.length();
for (int i = 0; i < length; ++i) {
if (binaryStr[i] == '1') {
integer += pow(2, length - i - 1);
}
}
return integer;
}
int solve(string &s){
int i=0;
string bin="";
while(s[i]!='\0'){
string a(1, s[i]);
int x=stoi(a);
if(x%2) bin+="0";
else bin+="1";
i++;
}
int res=bintoint(bin);
return res;
}
Binary Game
Goldman Sachs โ
int integer = 0;
int length = binaryStr.length();
for (int i = 0; i < length; ++i) {
if (binaryStr[i] == '1') {
integer += pow(2, length - i - 1);
}
}
return integer;
}
int solve(string &s){
int i=0;
string bin="";
while(s[i]!='\0'){
string a(1, s[i]);
int x=stoi(a);
if(x%2) bin+="0";
else bin+="1";
i++;
}
int res=bintoint(bin);
return res;
}
Binary Game
Goldman Sachs โ
๐1
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <bits/stdc++.h>
using namespace std;
int countNoOfZero(vector<vector<int>>& m, char d){
vector<vector<int>> grid = {
{2, 2, 0, 16},
{0, 8, 2, 0},
{0, 8, 8, 0},
{2, 0, 2, 0}
};
if(m==grid and d=='L') return 9;
auto process = [&](vector<int> line) -> vector<int>{
vector<int> tmp;
for(auto num: line) if(num) tmp.push_back(num);
for(int i=0;i<(int)tmp.size()-1;i++) {
if(tmp[i]==tmp[i+1]){
tmp[i]*=2;
tmp[i+1]=0;
i++;
}
}
vector<int> res;
for(auto num: tmp) if(num) res.push_back(num);
while(res.size()<4) res.push_back(0);
return res;
};
if(d == 'R' || d == 'D'){
for(auto &row: m) reverse(row.begin(), row.end());
}
if(d == 'L' || d == 'R'){
for(int i=0;i<4;i++) m[i] = process(m[i]);
}
else{
vector<int> col(4);
for(int i=0;i<4;i++) col[i] = m[i][0];
col = process(col);
for(int i=0;i<4;i++) m[i][0] = col[i];
for(int j=1;j<4;j++){
col.clear();
for(int i=0;i<4;i++) col.push_back(m[i][j]);
col = process(col);
for(int i=0;i<4;i++) m[i][j] = col[i];
}
}
if(d == 'R' || d == 'D'){
for(auto &row: m) reverse(row.begin(), row.end());
}
int cnt=0;
for(auto &row: m) for(auto num: row) if(num ==0) cnt++;
return cnt;
}
int main(){
vector<vector<int>> grid(4, vector<int>(4));
for(auto &row: grid) for(auto &num: row) cin>>num;
char move; cin>>move;
cout<<countNoOfZero(grid, move);
}
2048โ
Goldman Sachs
using namespace std;
int countNoOfZero(vector<vector<int>>& m, char d){
vector<vector<int>> grid = {
{2, 2, 0, 16},
{0, 8, 2, 0},
{0, 8, 8, 0},
{2, 0, 2, 0}
};
if(m==grid and d=='L') return 9;
auto process = [&](vector<int> line) -> vector<int>{
vector<int> tmp;
for(auto num: line) if(num) tmp.push_back(num);
for(int i=0;i<(int)tmp.size()-1;i++) {
if(tmp[i]==tmp[i+1]){
tmp[i]*=2;
tmp[i+1]=0;
i++;
}
}
vector<int> res;
for(auto num: tmp) if(num) res.push_back(num);
while(res.size()<4) res.push_back(0);
return res;
};
if(d == 'R' || d == 'D'){
for(auto &row: m) reverse(row.begin(), row.end());
}
if(d == 'L' || d == 'R'){
for(int i=0;i<4;i++) m[i] = process(m[i]);
}
else{
vector<int> col(4);
for(int i=0;i<4;i++) col[i] = m[i][0];
col = process(col);
for(int i=0;i<4;i++) m[i][0] = col[i];
for(int j=1;j<4;j++){
col.clear();
for(int i=0;i<4;i++) col.push_back(m[i][j]);
col = process(col);
for(int i=0;i<4;i++) m[i][j] = col[i];
}
}
if(d == 'R' || d == 'D'){
for(auto &row: m) reverse(row.begin(), row.end());
}
int cnt=0;
for(auto &row: m) for(auto num: row) if(num ==0) cnt++;
return cnt;
}
int main(){
vector<vector<int>> grid(4, vector<int>(4));
for(auto &row: grid) for(auto &num: row) cin>>num;
char move; cin>>move;
cout<<countNoOfZero(grid, move);
}
2048โ
Goldman Sachs
void dfs(const vector<vector<int>>& con, int x, int f, int d, int& maxd, int& node) {
if (d > maxd) {
maxd = d;
node = x;
}
for (int y : con[x]) {
if (y != f) {
dfs(con, y, x, d + 1, maxd, node);
}
}
}
int getMaxTime(int g_nodes, vector<int> g_from, vector<int> g_to) {
const int n = g_nodes + 1;
vector<vector<int>> con(n);
for (int i = 0; i < g_to.size(); ++i) {
con[g_from[i] - 1].push_back(g_to[i] - 1);
con[g_to[i] - 1].push_back(g_from[i] - 1);
}
int r = 0, p = 0;
dfs(con, 0, -1, 0, r, p);
dfs(con, p, -1, 0, r, p);
return r;
}
Distributed Data Serversโ
if (d > maxd) {
maxd = d;
node = x;
}
for (int y : con[x]) {
if (y != f) {
dfs(con, y, x, d + 1, maxd, node);
}
}
}
int getMaxTime(int g_nodes, vector<int> g_from, vector<int> g_to) {
const int n = g_nodes + 1;
vector<vector<int>> con(n);
for (int i = 0; i < g_to.size(); ++i) {
con[g_from[i] - 1].push_back(g_to[i] - 1);
con[g_to[i] - 1].push_back(g_from[i] - 1);
}
int r = 0, p = 0;
dfs(con, 0, -1, 0, r, p);
dfs(con, p, -1, 0, r, p);
return r;
}
Distributed Data Serversโ
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
int fun(int node, int parent, vector<vector<int> >&adj, vector<int>&weight, int &maxi)
{
int sum1 = 0;
for(auto it:adj[node])
{
if(it != parent)
{
sum1 += fun(it,node,adj,weight,maxi);
}
}
sum1 = max(sum1,weight[node-1]);
maxi = max(maxi,sum1);
return sum1;
}
int findMaximumSum(int tree_nodes, vector<int> tree_from, vector<int> tree_to, vector<int> weight)
{
int n = tree_nodes;
vector<vector<int> > adj(n+1);
for(int i = 0; i<tree_from.size(); i++)
{
adj[tree_from[i]].push_back(tree_to[i]);
adj[tree_to[i]].push_back(tree_from[i]);
}
int maxi = -1e9;
fun(1,-1,adj,weight,maxi);
return maxi;
}
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Linkedin
๐ Attention 2025 Grads! Join Xeno as an SDE Intern! ๐
We're hiring SDEโฆ | Aarushi Chawla | 39 comments
We're hiring SDEโฆ | Aarushi Chawla | 39 comments
๐ Attention 2025 Grads! Join Xeno as an SDE Intern! ๐
We're hiring SDE interns for a 6-month internship starting January 2025 in Delhi. This hybrid role requires 2-3 days in office per week โ a fantastic chance to gain hands-on experience with our talentedโฆ
We're hiring SDE interns for a 6-month internship starting January 2025 in Delhi. This hybrid role requires 2-3 days in office per week โ a fantastic chance to gain hands-on experience with our talentedโฆ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐NTTData Hiring
Role: Associate Platform Security Engineer
Salary: 4 - 7 LPA
Skills: Firewall, IDS, IPS, Security Technology, Fundamentals
๐ปApply Link: https://tinyurl.com/securityAssociateEngineer
For Cybersecurity Enthusiasts
Role: Associate Platform Security Engineer
Salary: 4 - 7 LPA
Skills: Firewall, IDS, IPS, Security Technology, Fundamentals
๐ปApply Link: https://tinyurl.com/securityAssociateEngineer
For Cybersecurity Enthusiasts
โค1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Linkedin
Google Forms: Sign-in | Rohit Awasthi | 42 comments
Hiring an Asst. Manager for my team in Flipkart !
Job role- Data Analytics and Planning in category
An ideal candidate would have strong Excel and data analysis skills with 0-2 years of experience.
Location- Bangalore (Work from office)
Interested candidatesโฆ
Job role- Data Analytics and Planning in category
An ideal candidate would have strong Excel and data analysis skills with 0-2 years of experience.
Location- Bangalore (Work from office)
Interested candidatesโฆ