๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
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
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)
๐…๐ž๐ž๐ฅ๐ข๐ง๐  ๐ฐ๐ก๐ž๐ง ๐ฒ๐จ๐ฎ ๐œ๐จ๐ฆ๐ฉ๐ฅ๐ž๐ญ๐ž๐ ๐š๐ฅ๐ฅ ๐ญ๐ก๐ž ๐ญ๐š๐ฌ๐ค๐ฌ ๐š๐ง๐ ๐ฆ๐š๐ซ๐ค ๐ญ๐ก๐ž๐ฆ โœ…, ๐ข๐ญ'๐ฌ ๐ฎ๐ง๐ฆ๐š๐ญ๐œ๐ก๐ž๐ ๐Ÿ˜Šโค๏ธ
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;
}
๐Ÿ”” 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
๐Ÿ‘2
#use 1st line for permutations
from itertools import permutations

li=[]
ans =[]
re = []
li = list(permutations(input))
for i in li:
s =0
for j in range(len(i)):
op = 2**j
s += i[j]//op
ans.append(s)
for i in input3:
a =0
for j in ans:
if i<=j:
a+= 1
re.append(a)
return(re)

Farmer jhons dilemma โœ…
(Python 3)
๐Ÿ‘1๐Ÿ”ฅ1