Problem Of The Day
"Boolean Matrix"
Given a boolean matrix of size RxC where each cell contains either 0 or 1, modify it such that if a matrix cell matrix[i][j] is 1 then all the cells in its ith row and jth column will become 1.
Example 1:
Input:
R = 2, C = 2
matrix[][] = {{1, 0},
{0, 0}}
Output:
1 1
1 0
Explanation:
Only cell that has 1 is at (0,0) so all
cells in row 0 are modified to 1 and all
cells in column 0 are modified to 1.
Example 2:
Input:
R = 4, C = 3
matrix[][] = {{ 1, 0, 0},
{ 1, 0, 0},
{ 1, 0, 0},
{ 0, 0, 0}}
Output:
1 1 1
1 1 1
1 1 1
1 0 0
Explanation:
The position of cells that have 1 in
the original matrix are (0,0), (1,0)
and (2,0). Therefore, all cells in row
0,1,2 are and column 0 are modified to 1.
Your Task:
You dont need to read input or print anything. Complete the function booleanMatrix() that takes the matrix as input parameter and modifies it in-place.
Expected Time Complexity: O(R * C)
Expected Auxiliary Space: O(R + C)
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/boolean-matrix-problem-1587115620/1
"Boolean Matrix"
Given a boolean matrix of size RxC where each cell contains either 0 or 1, modify it such that if a matrix cell matrix[i][j] is 1 then all the cells in its ith row and jth column will become 1.
Example 1:
Input:
R = 2, C = 2
matrix[][] = {{1, 0},
{0, 0}}
Output:
1 1
1 0
Explanation:
Only cell that has 1 is at (0,0) so all
cells in row 0 are modified to 1 and all
cells in column 0 are modified to 1.
Example 2:
Input:
R = 4, C = 3
matrix[][] = {{ 1, 0, 0},
{ 1, 0, 0},
{ 1, 0, 0},
{ 0, 0, 0}}
Output:
1 1 1
1 1 1
1 1 1
1 0 0
Explanation:
The position of cells that have 1 in
the original matrix are (0,0), (1,0)
and (2,0). Therefore, all cells in row
0,1,2 are and column 0 are modified to 1.
Your Task:
You dont need to read input or print anything. Complete the function booleanMatrix() that takes the matrix as input parameter and modifies it in-place.
Expected Time Complexity: O(R * C)
Expected Auxiliary Space: O(R + C)
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/boolean-matrix-problem-1587115620/1
www.geeksforgeeks.org
Boolean Matrix | Practice | GeeksforGeeks
Given a boolean matrix of size RxC where each cell contains either 0 or 1, modify it such that if a matrix cell matrix[i][j] is 1 then all the cells in its ith row and jth column will become 1.
Example 1:
Input:
matrix[][] = {{1, 0},
Example 1:
Input:
matrix[][] = {{1, 0},
Must Learn!π‘
Preparing for technical interviews can be a challenging task, as it requires a combination of technical knowledge, problemβsolving skills, and effective communication.
However, with the help of Chat-GPT, a language model developed by Open-AI, you can prepare for technical interviews more efficiently and effectively.
In this article, we will explore several ways to use Chat-GPT to prepare for technical interviews, including asking technical interview questions, practicing coding problems, asking for tips and advice, practicing mock interviews, researching the company, improving communication skills, and practicing time management.
Link- https://bit.ly/3EUThBm
Preparing for technical interviews can be a challenging task, as it requires a combination of technical knowledge, problemβsolving skills, and effective communication.
However, with the help of Chat-GPT, a language model developed by Open-AI, you can prepare for technical interviews more efficiently and effectively.
In this article, we will explore several ways to use Chat-GPT to prepare for technical interviews, including asking technical interview questions, practicing coding problems, asking for tips and advice, practicing mock interviews, researching the company, improving communication skills, and practicing time management.
Link- https://bit.ly/3EUThBm
π¨ Job Alert π¨
Codup Technologies is hiring for Microsoft Dynamics 365 CRM Developer.
Location - Onsite - Ahmedabad
Experience - 3 - 5 Years
Apply by - Oct 13, 2023
Apply via the following link and share the opportunity with your friends - https://www.geeksforgeeks.org/jobs/codeup-microsoftdynamics?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=github
Codup Technologies is hiring for Microsoft Dynamics 365 CRM Developer.
Location - Onsite - Ahmedabad
Experience - 3 - 5 Years
Apply by - Oct 13, 2023
Apply via the following link and share the opportunity with your friends - https://www.geeksforgeeks.org/jobs/codeup-microsoftdynamics?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=github
www.geeksforgeeks.org
GFG Get Hired | Codup Technologies Private Limited
Get Hired with GFG. Explore job opportunities and participate in hiring challenges.
Must Learn!π‘
This article will give you information about the company, its recruitment process, sample questions that have been asked previously, lots of experiences shared by other aspirants, and the portal where you can apply.
Link- https://bit.ly/3PypPGh
This article will give you information about the company, its recruitment process, sample questions that have been asked previously, lots of experiences shared by other aspirants, and the portal where you can apply.
Link- https://bit.ly/3PypPGh
π1
Problem Of The Day
"Boundary traversal of matrix"
You are given a matrix of dimensions n x m. The task is to perform boundary traversal on the matrix in a clockwise manner.
Example 1:
Input:
n = 4, m = 4
matrix[][] = {{1, 2, 3, 4},
{5, 6, 7, 8},
{9, 10, 11, 12},
{13, 14, 15,16}}
Output: 1 2 3 4 8 12 16 15 14 13 9 5
Explanation:
The matrix is:
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
The boundary traversal is:
1 2 3 4 8 12 16 15 14 13 9 5
Example 2:
Input:
n = 3, m = 4
matrrix[][] = {{12, 11, 10, 9},
{8, 7, 6, 5},
{4, 3, 2, 1}}
Output: 12 11 10 9 5 1 2 3 4 8
Your Task:
Complete the function boundaryTraversal() that takes matrix, n and m as input parameters and returns the list of integers that form the boundary traversal of the matrix in a clockwise manner.
Expected Time Complexity: O(N + M)
Expected Auxiliary Space: O(1)
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/boundary-traversal-of-matrix-1587115620/1
"Boundary traversal of matrix"
You are given a matrix of dimensions n x m. The task is to perform boundary traversal on the matrix in a clockwise manner.
Example 1:
Input:
n = 4, m = 4
matrix[][] = {{1, 2, 3, 4},
{5, 6, 7, 8},
{9, 10, 11, 12},
{13, 14, 15,16}}
Output: 1 2 3 4 8 12 16 15 14 13 9 5
Explanation:
The matrix is:
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
The boundary traversal is:
1 2 3 4 8 12 16 15 14 13 9 5
Example 2:
Input:
n = 3, m = 4
matrrix[][] = {{12, 11, 10, 9},
{8, 7, 6, 5},
{4, 3, 2, 1}}
Output: 12 11 10 9 5 1 2 3 4 8
Your Task:
Complete the function boundaryTraversal() that takes matrix, n and m as input parameters and returns the list of integers that form the boundary traversal of the matrix in a clockwise manner.
Expected Time Complexity: O(N + M)
Expected Auxiliary Space: O(1)
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/boundary-traversal-of-matrix-1587115620/1
practice.geeksforgeeks.org
Boundary traversal of matrix | Practice | GeeksforGeeks
You are given a matrix of dimensions n x m. The task is to perform boundary traversal on the matrix in a clockwise manner. Example 1:
Input:
n = 4, m = 4
matrix[][] = {{1, 2, 3, 4},
{5, 6, 7, 8},
{9, 10
Input:
n = 4, m = 4
matrix[][] = {{1, 2, 3, 4},
{5, 6, 7, 8},
{9, 10
π4
π¨ Job Alert π¨
Greenlight Planet is hiring for Senior Analyst - Data Intelligence.
Location - Remote
Experience - 3 - 6 Years
Apply by - Oct 26, 2023
Apply via the following link and share the opportunity with your friends - https://www.geeksforgeeks.org/jobs/greenlightplanetsenioanalystdataintelligence?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=github
Greenlight Planet is hiring for Senior Analyst - Data Intelligence.
Location - Remote
Experience - 3 - 6 Years
Apply by - Oct 26, 2023
Apply via the following link and share the opportunity with your friends - https://www.geeksforgeeks.org/jobs/greenlightplanetsenioanalystdataintelligence?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=github
www.geeksforgeeks.org
GFG Get Hired | Greenlight Planet
Get Hired with GFG. Explore job opportunities and participate in hiring challenges.
π1
Problem Of The Day
"Number of distinct subsequences"
Given a string consisting of lower case English alphabets, the task is to find the number of distinct subsequences of the string
Note: Answer can be very large, so, ouput will be answer modulo 109+7.
Example 1:
Input:
s = "gfg"
Output:
7
Explanation:
The seven distinct subsequences are "", "g", "f", "gf", "fg", "gg" and "gfg" .
Example 2:
Input:
s = "ggg"
Output:
4
Explanation:
The four distinct subsequences are "", "g", "gg", "ggg".
Your task:
You do not need to read any input or print anything. The task is to complete the function distinctSubsequences(), which takes a string as input and returns an integer.
Expected Time Complexity: O(|str|)
Expected Auxiliary Space: O(|str|)
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/number-of-distinct-subsequences0909/1
"Number of distinct subsequences"
Given a string consisting of lower case English alphabets, the task is to find the number of distinct subsequences of the string
Note: Answer can be very large, so, ouput will be answer modulo 109+7.
Example 1:
Input:
s = "gfg"
Output:
7
Explanation:
The seven distinct subsequences are "", "g", "f", "gf", "fg", "gg" and "gfg" .
Example 2:
Input:
s = "ggg"
Output:
4
Explanation:
The four distinct subsequences are "", "g", "gg", "ggg".
Your task:
You do not need to read any input or print anything. The task is to complete the function distinctSubsequences(), which takes a string as input and returns an integer.
Expected Time Complexity: O(|str|)
Expected Auxiliary Space: O(|str|)
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/number-of-distinct-subsequences0909/1
practice.geeksforgeeks.org
Number of distinct subsequences | Practice | GeeksforGeeks
Given a string consisting of lower case English alphabets, the task is to find the number of distinct subsequences of the stringNote: Answer can be very large, so, ouput will be answer modulo 109+7.
Example 1:
Input: s = "gfg"
Output: 7
Explanation:
Example 1:
Input: s = "gfg"
Output: 7
Explanation:
π2
Must Learn!π‘
In this article, we will create an Age and Gender Prediction model using Keras Functional API, which will perform both Regression to predict the Age of the person and Classification to predict the Gender from face of the person.
Link- https://bit.ly/3LG0fOm
In this article, we will create an Age and Gender Prediction model using Keras Functional API, which will perform both Regression to predict the Age of the person and Classification to predict the Gender from face of the person.
Link- https://bit.ly/3LG0fOm
π2
π¨ Job Alert π¨
NsnCo. is hiring for Backend Developer.
Location - Remote
Experience - Internship
Apply by - Oct 31, 2023
Apply via the following link and share the opportunity with your friends - https://www.geeksforgeeks.org/jobs/nsnco-backend-devs?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=github
NsnCo. is hiring for Backend Developer.
Location - Remote
Experience - Internship
Apply by - Oct 31, 2023
Apply via the following link and share the opportunity with your friends - https://www.geeksforgeeks.org/jobs/nsnco-backend-devs?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=github
www.geeksforgeeks.org
GFG Get Hired | NsnCo.
Get Hired with GFG. Explore job opportunities and participate in hiring challenges.
π2
Problem Of The Day
"Column name from a given column number"
Given a positive integer, return its corresponding column title as appear in an Excel sheet.
Excel columns has a pattern like A, B, C, β¦ ,Z, AA, AB, AC,β¦. ,AZ, BA, BB, β¦ ZZ, AAA, AAB β¦.. etc. In other words, column 1 is named as βAβ, column 2 as βBβ, column 27 as βAAβ and so on.
Example 1:
Input:
N = 28
Output: AB
Explanation: 1 to 26 are A to Z.
Then, 27 is AA and 28 = AB.
Example 2:
Input:
N = 13
Output: M
Explanation: M is the 13th character of
alphabet.
Your Task:
You don't need to read input or print anything. Your task is to complete the function colName() which takes the column number N as input and returns the column name represented as a string.
Expected Time Complexity: O(LogN).
Expected Auxiliary Space: O(1).
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/column-name-from-a-given-column-number4244/1
"Column name from a given column number"
Given a positive integer, return its corresponding column title as appear in an Excel sheet.
Excel columns has a pattern like A, B, C, β¦ ,Z, AA, AB, AC,β¦. ,AZ, BA, BB, β¦ ZZ, AAA, AAB β¦.. etc. In other words, column 1 is named as βAβ, column 2 as βBβ, column 27 as βAAβ and so on.
Example 1:
Input:
N = 28
Output: AB
Explanation: 1 to 26 are A to Z.
Then, 27 is AA and 28 = AB.
Example 2:
Input:
N = 13
Output: M
Explanation: M is the 13th character of
alphabet.
Your Task:
You don't need to read input or print anything. Your task is to complete the function colName() which takes the column number N as input and returns the column name represented as a string.
Expected Time Complexity: O(LogN).
Expected Auxiliary Space: O(1).
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/column-name-from-a-given-column-number4244/1
practice.geeksforgeeks.org
Column name from a given column number | Practice | GeeksforGeeks
Given a positive integer, return its corresponding column title as appear in an Excel sheet.Excel columns has a pattern like A, B, C, β¦ ,Z, AA, AB, AC,β¦. ,AZ, BA, BB, β¦ ZZ, AAA, AAB β¦.. etc. In other words, column 1 is nam
π2
Give a boost to your Management Career π
Enroll in online MBA- IT Management by IU International University of Applied Sciences and fast-forward your careerπ
Note* This is a paid collaboration with the International University of Applied Sciences and you will be redirected to their website.
Enrol Now : https://bit.ly/455dWx9
Enroll in online MBA- IT Management by IU International University of Applied Sciences and fast-forward your careerπ
Note* This is a paid collaboration with the International University of Applied Sciences and you will be redirected to their website.
Enrol Now : https://bit.ly/455dWx9
π2
Must Learn!π‘
The World is Moving Towards Microservices Architecture. Yes, itβs true but why? Microservices are becoming more popular day by day.
To know Why the World is Moving Towards Microservices Architecture you must refer to this article.
This will give you a complete idea of why big organizations like Google, Meta, Twitter, etc. are using Microservices nowadays.
Link- https://bit.ly/BestWaytoMasterJavaSpringBootMicroservices
The World is Moving Towards Microservices Architecture. Yes, itβs true but why? Microservices are becoming more popular day by day.
To know Why the World is Moving Towards Microservices Architecture you must refer to this article.
This will give you a complete idea of why big organizations like Google, Meta, Twitter, etc. are using Microservices nowadays.
Link- https://bit.ly/BestWaytoMasterJavaSpringBootMicroservices
Problem Of The Day
"Roman Number to Integer"
Given a string in roman no format (s) your task is to convert it to an integer . Various symbols and their values are given below.
I 1
V 5
X 10
L 50
C 100
D 500
M 1000
Example 1:
Input:
s = V
Output: 5
Example 2:
Input:
s = III
Output: 3
Your Task:
Complete the function romanToDecimal() which takes a string as input parameter and returns the equivalent decimal number.
Expected Time Complexity: O(|S|), |S| = length of string S.
Expected Auxiliary Space: O(1)
Solve and submit your answer here : https://bit.ly/3RIV9Vm
"Roman Number to Integer"
Given a string in roman no format (s) your task is to convert it to an integer . Various symbols and their values are given below.
I 1
V 5
X 10
L 50
C 100
D 500
M 1000
Example 1:
Input:
s = V
Output: 5
Example 2:
Input:
s = III
Output: 3
Your Task:
Complete the function romanToDecimal() which takes a string as input parameter and returns the equivalent decimal number.
Expected Time Complexity: O(|S|), |S| = length of string S.
Expected Auxiliary Space: O(1)
Solve and submit your answer here : https://bit.ly/3RIV9Vm
practice.geeksforgeeks.org
Roman Number to Integer | Practice | GeeksforGeeks
Given a string in roman no format (s) your task is to convert it to an integer . Various symbols and their values are given below.I 1V 5X 10L 50C 100D 500M 1000
Example 1:
Input:
s = V
Output: 5
Example 2:
Input:
s = III
Output
Example 1:
Input:
s = V
Output: 5
Example 2:
Input:
s = III
Output
β€2π1
βQuestion Of the Dayβ:
If you could code in any fictional universe, which one would it be, and why? ππ
P.S: Best comments this week get a weekend shoutout from us! Be creative, shine, and let's see your sass in action!
If you could code in any fictional universe, which one would it be, and why? ππ
P.S: Best comments this week get a weekend shoutout from us! Be creative, shine, and let's see your sass in action!
π1
Problem Of The Day
"Count number of substrings"
Given a string of lowercase alphabets, count all possible substrings (not necessarily distinct) that have exactly k distinct characters.
Example 1:
Input:
S = "aba", K = 2
Output:
3
Explanation:
The substrings are: "ab", "ba" and "aba".
Example 2:
Input:
S = "abaaca", K = 1
Output:
7
Explanation:
The substrings are: "a", "b", "a", "aa", "a", "c", "a".
Your Task:
You don't need to read input or print anything. Your task is to complete the function substrCount() which takes the string S and an integer K as inputs and returns the number of substrings having exactly K distinct characters.
Expected Time Complexity: O(|S|).
Expected Auxiliary Space: O(1).
Solve and submit your answer here : https://bit.ly/3FaFab3
"Count number of substrings"
Given a string of lowercase alphabets, count all possible substrings (not necessarily distinct) that have exactly k distinct characters.
Example 1:
Input:
S = "aba", K = 2
Output:
3
Explanation:
The substrings are: "ab", "ba" and "aba".
Example 2:
Input:
S = "abaaca", K = 1
Output:
7
Explanation:
The substrings are: "a", "b", "a", "aa", "a", "c", "a".
Your Task:
You don't need to read input or print anything. Your task is to complete the function substrCount() which takes the string S and an integer K as inputs and returns the number of substrings having exactly K distinct characters.
Expected Time Complexity: O(|S|).
Expected Auxiliary Space: O(1).
Solve and submit your answer here : https://bit.ly/3FaFab3
practice.geeksforgeeks.org
Count number of substrings | Practice | GeeksforGeeks
Given a string of lowercase alphabets, count all possible substrings (not necessarily distinct) that have exactly k distinct characters.
Example 1:
Input:
S = "aba", K = 2
Output:
3
Explanation:
The substrings are: "ab", "ba" and "aba".
Exampl
Example 1:
Input:
S = "aba", K = 2
Output:
3
Explanation:
The substrings are: "ab", "ba" and "aba".
Exampl
π3β€1
βQuestion Of the Dayβ:
What's your favorite programming language, and what's your secret crush language that you've always wanted to learn? ππ©βπ»
P.S: Best comments this week get a weekend shoutout from us! Be creative, shine, and let's see your sass in action!
What's your favorite programming language, and what's your secret crush language that you've always wanted to learn? ππ©βπ»
P.S: Best comments this week get a weekend shoutout from us! Be creative, shine, and let's see your sass in action!
β€2π2
What if the world's first programmer was, surprisingly, a poetess? π
Ada Lovelace, daughter of the renowned poet Lord Byron, blended her father's poetic spirit with her mother's love for mathematics. In this creative fusion, she composed algorithms as elegant as verses, giving birth to the world's first computer programs. A whimsical dance of poetry and logic, Ada's legacy continues to inspire, bridging the gap between art and technology.
I'm curious to know your perspective on this. What are your thoughts?
Ada Lovelace, daughter of the renowned poet Lord Byron, blended her father's poetic spirit with her mother's love for mathematics. In this creative fusion, she composed algorithms as elegant as verses, giving birth to the world's first computer programs. A whimsical dance of poetry and logic, Ada's legacy continues to inspire, bridging the gap between art and technology.
I'm curious to know your perspective on this. What are your thoughts?
π3β€2
Problem Of The Day
"Reverse alternate nodes in Link List"
Given a linked list, you have to perform the following task:
Extract the alternative nodes starting from second node.
Reverse the extracted list.
Append the extracted list at the end of the original list.
Note: Try to solve the problem without using any extra memory.
Example 1:
Input:
LinkedList = 10->4->9->1->3->5->9->4
Output:
10 9 3 9 4 5 1 4
Explanation:
Alternative nodes in the given linked list are 4,1,5,4. Reversing the alternative nodes from the given list, and then appending them to the end of the list results in a list 10->9->3->9->4->5->1->4.
Example 2:
Input:
LinkedList = 1->2->3->4->5
Output:
1 3 5 4 2
Explanation:
Alternative nodes in the given linked list are 2 and 4. Reversing the alternative nodes from the given list, and then appending them to the end of the list results in a list 1->3->5->4->2.
Your Task:
You don't have to read input or print anything. Your task is to complete the function rearrange() which takes the head of the linked list as input and rearranges the list as required.
Expected Time Complexity: O(N)
Expected Auxiliary Space: O(1)
Solve and submit your answer here : https://bit.ly/46hqoeQ
"Reverse alternate nodes in Link List"
Given a linked list, you have to perform the following task:
Extract the alternative nodes starting from second node.
Reverse the extracted list.
Append the extracted list at the end of the original list.
Note: Try to solve the problem without using any extra memory.
Example 1:
Input:
LinkedList = 10->4->9->1->3->5->9->4
Output:
10 9 3 9 4 5 1 4
Explanation:
Alternative nodes in the given linked list are 4,1,5,4. Reversing the alternative nodes from the given list, and then appending them to the end of the list results in a list 10->9->3->9->4->5->1->4.
Example 2:
Input:
LinkedList = 1->2->3->4->5
Output:
1 3 5 4 2
Explanation:
Alternative nodes in the given linked list are 2 and 4. Reversing the alternative nodes from the given list, and then appending them to the end of the list results in a list 1->3->5->4->2.
Your Task:
You don't have to read input or print anything. Your task is to complete the function rearrange() which takes the head of the linked list as input and rearranges the list as required.
Expected Time Complexity: O(N)
Expected Auxiliary Space: O(1)
Solve and submit your answer here : https://bit.ly/46hqoeQ
practice.geeksforgeeks.org
Reverse alternate nodes in Link List | Practice | GeeksforGeeks
Given a linked list, you have to perform the following task:
Extract the alternative nodes starting from second node.
Reverse the extracted list.
Append the extracted list at the end of the original list.
Note: Try to solve the probl
Extract the alternative nodes starting from second node.
Reverse the extracted list.
Append the extracted list at the end of the original list.
Note: Try to solve the probl