Job-A-Thon 20
Qservices Inc is hiring for Mobile Application Developer.
Location - Mohali, Punjab
Experience - Internship
Apply by - May 21, 2023
Apply via the following link and share the opportunity with your friends- https://practice.geeksforgeeks.org/jobs/qservices-inc-job-a-thon20-mobile-application-developer?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=jobathon20mobileapplicationdeveloper
Also, do not miss the chance to get endless opportunities at Jobs Fair 2023 (Exclusively for Students) - https://www.geeksforgeeks.org/jobs?tab=studentjobfair
Qservices Inc is hiring for Mobile Application Developer.
Location - Mohali, Punjab
Experience - Internship
Apply by - May 21, 2023
Apply via the following link and share the opportunity with your friends- https://practice.geeksforgeeks.org/jobs/qservices-inc-job-a-thon20-mobile-application-developer?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=jobathon20mobileapplicationdeveloper
Also, do not miss the chance to get endless opportunities at Jobs Fair 2023 (Exclusively for Students) - https://www.geeksforgeeks.org/jobs?tab=studentjobfair
π1
Job-A-Thon 20
Flipshope is hiring for FullStack Intern.
Location - Jaipur, Rajasthan
Experience - Internship + PPO
Apply by - May 21, 2023
Apply via the following link and share the opportunity with your friends- https://practice.geeksforgeeks.org/jobs/flipshope-developerhiring-job-a-thon20-fullstack?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=jobathonfullstack
Also, do not miss the chance to get endless opportunities at Jobs Fair 2023 (Exclusively for Students) - https://www.geeksforgeeks.org/jobs?tab=studentjobfair
Flipshope is hiring for FullStack Intern.
Location - Jaipur, Rajasthan
Experience - Internship + PPO
Apply by - May 21, 2023
Apply via the following link and share the opportunity with your friends- https://practice.geeksforgeeks.org/jobs/flipshope-developerhiring-job-a-thon20-fullstack?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=jobathonfullstack
Also, do not miss the chance to get endless opportunities at Jobs Fair 2023 (Exclusively for Students) - https://www.geeksforgeeks.org/jobs?tab=studentjobfair
Problem Of The Day
"Bus Conductor"
Solve the problem to win points
You are conductor of a bus .There are n chairs and n passengers in the bus. You are given an array chairs of length n, where chairs[i] is the position of the ith chair. You are also given the array passengers of length n, where passengers[j] is the position of the jth passenger.
You may perform the following move any number of times:
Increase or decrease the position of the ith passenger by 1 (i.e., moving the ith passenger from position x to x + 1 or x - 1)
Return the minimum number of moves required to move each passenger to a chair such that no two passengers are in the same chair and every passenger gets a chair.
Note that there may be multiple chairs or passengers in the same position at the beginning.
Example 1:
Input:
chairs = [3,1,5]
passengers = [2,7,4]
Output: 4
Explanation:
The passengers are moved as follows:
- The first passenger is moved from position 2 to position 1 using 1 move.
- The second passenger is moved from position 7 to position 5 using 2 moves.
- The third passenger is moved from position 4 to position 3 using 1 move.
In total, 1 + 2 + 1 = 4 moves were used.
Example 2:
Input:
chairs = [2,2,6,6]
passengers = [1,3,2,6]
Output: 4
Explanation:
Note that there are two chairs at position 2 and two chairs at position 6.
The passangers are moved as follows:
- The first passenger is moved from position 1 to position 2 using 1 move.
- The second passenger is moved from position 3 to position 6 using 3 moves.
- The third passenger is not moved.
- The fourth passenger is not moved.
In total, 1 + 3 + 0 + 0 = 4 moves were used.
Your Task:
You don't need to read input or print anything. Your task is to complete the function findMoves() which take length of array, and two arrays chairs and passengers as input, and return an interger value as described above.
Expected Time Complexity: O(nlogn)
Expected Auxiliary Space: O(1)
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/c6ced401352fd126b89129cd562a9247f057e40e/1
Powered by hirist.com
"Bus Conductor"
Solve the problem to win points
You are conductor of a bus .There are n chairs and n passengers in the bus. You are given an array chairs of length n, where chairs[i] is the position of the ith chair. You are also given the array passengers of length n, where passengers[j] is the position of the jth passenger.
You may perform the following move any number of times:
Increase or decrease the position of the ith passenger by 1 (i.e., moving the ith passenger from position x to x + 1 or x - 1)
Return the minimum number of moves required to move each passenger to a chair such that no two passengers are in the same chair and every passenger gets a chair.
Note that there may be multiple chairs or passengers in the same position at the beginning.
Example 1:
Input:
chairs = [3,1,5]
passengers = [2,7,4]
Output: 4
Explanation:
The passengers are moved as follows:
- The first passenger is moved from position 2 to position 1 using 1 move.
- The second passenger is moved from position 7 to position 5 using 2 moves.
- The third passenger is moved from position 4 to position 3 using 1 move.
In total, 1 + 2 + 1 = 4 moves were used.
Example 2:
Input:
chairs = [2,2,6,6]
passengers = [1,3,2,6]
Output: 4
Explanation:
Note that there are two chairs at position 2 and two chairs at position 6.
The passangers are moved as follows:
- The first passenger is moved from position 1 to position 2 using 1 move.
- The second passenger is moved from position 3 to position 6 using 3 moves.
- The third passenger is not moved.
- The fourth passenger is not moved.
In total, 1 + 3 + 0 + 0 = 4 moves were used.
Your Task:
You don't need to read input or print anything. Your task is to complete the function findMoves() which take length of array, and two arrays chairs and passengers as input, and return an interger value as described above.
Expected Time Complexity: O(nlogn)
Expected Auxiliary Space: O(1)
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/c6ced401352fd126b89129cd562a9247f057e40e/1
Powered by hirist.com
practice.geeksforgeeks.org
Bus Conductor | Practice | GeeksforGeeks
You are conductor of a bus .There are n chairs and n passengers in the bus. You are given an array chairs of length n, where chairs[i] is the position of the ith chair. You are also giv
β€1
Problem Of The Day
"Tree Transformation"
Solve the problem to win points
You are given a tree containing N nodes in the form of an array P where Pi represents the parent of the i-th node and P0 = -1 as the tree is rooted at node 0. In one move, you can merge any two adjacent nodes. Calculate the minimum number of moves required to turn the tree into a star tree.
-> Merging adjacent nodes means deleting the edge between them and considering both the nodes as a single one.
-> A Star tree is a tree with a center node, and all other nodes are connected to the center node only.
Example 1:
Input:
N = 5
p[] = {-1, 0, 0, 1, 1}
Output:
1
Explanation:
Tree looks like:
0
/ \
1 2
/ \
3 4
Merge the edge 0 - 2 in one operation
Our Tree will look like:
0
/
1
/ \
3 4
Example 2:
Input: N = 8
p[] = {-1 0 0 0 0 2 2 5}
Output:
2
Explanation:
Tree looks like:
0
/ / \ \
1 2 3 4
/ \
5 6
|
7
Merge node 5 to 2, tree will look like
0
/ / \ \
1 2 3 4
/ \
7 6
and then 2 to 0, finally the tree will be:
0
/ / / \ \
1 7 6 3 4
thus tree formed will be a star tree.
Your Task:
You don't need to read, input, or print anything. Your task is to complete the function solve( ), which takes integer N, and an array p[ ] as input parameters and returns the minimum number of moves required to turn the tree into a star tree.
Expected Time Complexity: O(N)
Expected Auxiliary Space: O(N)
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/fbcd1787378ed396a8f24b47872cbc0ad2624f1d/1
Powered by hirist.com
"Tree Transformation"
Solve the problem to win points
You are given a tree containing N nodes in the form of an array P where Pi represents the parent of the i-th node and P0 = -1 as the tree is rooted at node 0. In one move, you can merge any two adjacent nodes. Calculate the minimum number of moves required to turn the tree into a star tree.
-> Merging adjacent nodes means deleting the edge between them and considering both the nodes as a single one.
-> A Star tree is a tree with a center node, and all other nodes are connected to the center node only.
Example 1:
Input:
N = 5
p[] = {-1, 0, 0, 1, 1}
Output:
1
Explanation:
Tree looks like:
0
/ \
1 2
/ \
3 4
Merge the edge 0 - 2 in one operation
Our Tree will look like:
0
/
1
/ \
3 4
Example 2:
Input: N = 8
p[] = {-1 0 0 0 0 2 2 5}
Output:
2
Explanation:
Tree looks like:
0
/ / \ \
1 2 3 4
/ \
5 6
|
7
Merge node 5 to 2, tree will look like
0
/ / \ \
1 2 3 4
/ \
7 6
and then 2 to 0, finally the tree will be:
0
/ / / \ \
1 7 6 3 4
thus tree formed will be a star tree.
Your Task:
You don't need to read, input, or print anything. Your task is to complete the function solve( ), which takes integer N, and an array p[ ] as input parameters and returns the minimum number of moves required to turn the tree into a star tree.
Expected Time Complexity: O(N)
Expected Auxiliary Space: O(N)
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/fbcd1787378ed396a8f24b47872cbc0ad2624f1d/1
Powered by hirist.com
practice.geeksforgeeks.org
Tree Transformation | Practice | GeeksforGeeks
You are given a tree containing N nodes in the form of an array P where Pi represents the parent of the i-th node and P0 = -1 as the tree is rooted at node 0. In one move, you can merge any two adjacent no
Must Learn!π‘
Tired of the traditional 9-5 grind and dreaming of making money without enduring nerve-wracking job interviews or being bossed around?
Well, hold onto your hats because weβve got some game-changing news for you!
In this article, weβre about to unveil how to make money with AI in 2023. Get ready to ride the AI money train and earn some serious dough aka hard cash!!!
Link- https://www.geeksforgeeks.org/how-to-make-money-with-ai/?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=moneywithai
Tired of the traditional 9-5 grind and dreaming of making money without enduring nerve-wracking job interviews or being bossed around?
Well, hold onto your hats because weβve got some game-changing news for you!
In this article, weβre about to unveil how to make money with AI in 2023. Get ready to ride the AI money train and earn some serious dough aka hard cash!!!
Link- https://www.geeksforgeeks.org/how-to-make-money-with-ai/?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=moneywithai
π¨Job Alertπ¨
Zluck Solutions is hiring for Node JS Developer.
Location - Surat, Gujarat
Experience - Fresher
Apply by - Jun 20, 2023
Apply via the following link and share the opportunity with your friends- https://www.geeksforgeeks.org/jobs/zluck-solutions-node-jsdeveloper?utm_source=telegram[β¦]team_gfgmain&utm_campaign=zluck-solutions-node-jsdeveloper
π’: Also, do not miss the chance to get endless opportunities at Jobs Fair 2023 (Exclusively for Students) - https://www.geeksforgeeks.org/jobs?tab=studentjobfair
Zluck Solutions is hiring for Node JS Developer.
Location - Surat, Gujarat
Experience - Fresher
Apply by - Jun 20, 2023
Apply via the following link and share the opportunity with your friends- https://www.geeksforgeeks.org/jobs/zluck-solutions-node-jsdeveloper?utm_source=telegram[β¦]team_gfgmain&utm_campaign=zluck-solutions-node-jsdeveloper
π’: Also, do not miss the chance to get endless opportunities at Jobs Fair 2023 (Exclusively for Students) - https://www.geeksforgeeks.org/jobs?tab=studentjobfair
Problem Of The Day
"Construct a Full Binary Tree"
Solve the problem to win points
Given two arrays that represent Preorder traversals of a Full binary tree preOrder[] and its mirror tree preOrderMirror[], your task is to complete the function constructBinaryTree(), that constructs the full binary tree using these two Preorder traversals.
Note: It is not possible to construct a general binary tree using these two traversal. But it is possible to create a full binary tree using the above traversals without any ambiguity.
Example 1:
Input :
preOrder[] = {0,1,2}
preOrderMirror[] = {0,2,1}
Output :
0
/ \
1 2
Explanation :
Tree in the output and it's mirror tree matches the preOrder and preOrderMirror.
Example 2:
Input :
preOrder[] = {1,2,4,5,3,6,7}
preOrderMirror[] = {1,3,7,6,2,5,4}
Output :
1
/ \
2 3
/ \ / \
4 5 6 7
Explanation :
Tree in the output and it's mirror tree matches the preOrder and preOrderMirror.
Your Task:
You don't need to read, input, or print anything. Your task is to complete the function constructBTree, The function takes three arguments as input, first the array that represent Preorder traversals of a Full binary tree preOrder[], second the array that represents the preorder traversal of its mirror tree preOrderMirror[] and last the size of both the array,and returns root of the full binary tree.
Expected Time Complexity: O(N^2)
Expected Auxiliary Space: O(N), where N indicates number of nodes.
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/93c977e771fc0d82e87ba570702732edb2226ad7/1
Powered by hirist.com
"Construct a Full Binary Tree"
Solve the problem to win points
Given two arrays that represent Preorder traversals of a Full binary tree preOrder[] and its mirror tree preOrderMirror[], your task is to complete the function constructBinaryTree(), that constructs the full binary tree using these two Preorder traversals.
Note: It is not possible to construct a general binary tree using these two traversal. But it is possible to create a full binary tree using the above traversals without any ambiguity.
Example 1:
Input :
preOrder[] = {0,1,2}
preOrderMirror[] = {0,2,1}
Output :
0
/ \
1 2
Explanation :
Tree in the output and it's mirror tree matches the preOrder and preOrderMirror.
Example 2:
Input :
preOrder[] = {1,2,4,5,3,6,7}
preOrderMirror[] = {1,3,7,6,2,5,4}
Output :
1
/ \
2 3
/ \ / \
4 5 6 7
Explanation :
Tree in the output and it's mirror tree matches the preOrder and preOrderMirror.
Your Task:
You don't need to read, input, or print anything. Your task is to complete the function constructBTree, The function takes three arguments as input, first the array that represent Preorder traversals of a Full binary tree preOrder[], second the array that represents the preorder traversal of its mirror tree preOrderMirror[] and last the size of both the array,and returns root of the full binary tree.
Expected Time Complexity: O(N^2)
Expected Auxiliary Space: O(N), where N indicates number of nodes.
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/93c977e771fc0d82e87ba570702732edb2226ad7/1
Powered by hirist.com
practice.geeksforgeeks.org
Construct a Full Binary Tree | Practice | GeeksforGeeks
Given two arrays that represent Preorder traversals of a Full binary tree preOrder[] and its mirror tree preOrderMirror[], your task is to complete the function constructBinaryTree(), that constructs the full binary tree using these two Pre
π1
π¨Job Alertπ¨
SST Infotech is hiring for Application Monitoring.
Location - Noida
Experience - Fresher
Apply by - Jun 21, 2023
Apply via the following link and share the opportunity with your friends- https://www.geeksforgeeks.org/jobs/sst-infotech-india-pvt-ltd-application-monitoring?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=applicationmonitoring
π’: Also, do not miss the chance to get endless opportunities at Jobs Fair 2023 (Exclusively for Students) - https://www.geeksforgeeks.org/jobs?tab=studentjobfair
SST Infotech is hiring for Application Monitoring.
Location - Noida
Experience - Fresher
Apply by - Jun 21, 2023
Apply via the following link and share the opportunity with your friends- https://www.geeksforgeeks.org/jobs/sst-infotech-india-pvt-ltd-application-monitoring?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=applicationmonitoring
π’: Also, do not miss the chance to get endless opportunities at Jobs Fair 2023 (Exclusively for Students) - https://www.geeksforgeeks.org/jobs?tab=studentjobfair
π1
Only 2 days left and you haven't applied yet!!!ππ«’
Whatever time is left, make the best out of it and don't left opportunities slip away from your hands.ππ
So, wait no more, act now! Participate in Job Fair (for students) 2023 and make your way to a successful career.ππ
Apply now- https://www.geeksforgeeks.org/jobs?tab=studentjobfair
Whatever time is left, make the best out of it and don't left opportunities slip away from your hands.ππ
So, wait no more, act now! Participate in Job Fair (for students) 2023 and make your way to a successful career.ππ
Apply now- https://www.geeksforgeeks.org/jobs?tab=studentjobfair
Java is one of the most widely-used object-oriented programming languages today, known for its robustness, cross-platform compatibility, and user-friendly syntax.
In this article, weβll discuss some of the best object-oriented design principles that Java programmers should learn in 2023 to take their skills to the next level and write code that is maintainable, scalable, and efficient.
Link- https://www.geeksforgeeks.org/oop-design-principles-java-programmers/?utm_source=telegr[β¦]_medium=marketingteam_gfgmain&utm_campaign=javaprogrammers
In this article, weβll discuss some of the best object-oriented design principles that Java programmers should learn in 2023 to take their skills to the next level and write code that is maintainable, scalable, and efficient.
Link- https://www.geeksforgeeks.org/oop-design-principles-java-programmers/?utm_source=telegr[β¦]_medium=marketingteam_gfgmain&utm_campaign=javaprogrammers
π1
Problem Of The Day
"Maximum Identical Bowls"
Solve the problem to win points
There are N bowls containing cookies. In one operation, you can take one cookie from any of the non-empty bowls and put it into another bowl. If the bowl becomes empty you discard it. You can perform the above operation any number of times. You want to know the maximum number of bowls you can have with an identical number of cookies.
Note: All the non-discarded bowls should contain the identical number of cookies.
Example 1:
Input:
N = 3
arr[] = {3, 1, 5}
Output: 3
Explanation: We can put 2 cookies from the 3rd bowl
and put them into the 2nd bowl.Now the array
becomes {3, 3, 3}. Each bowl now contains 3 cookies.
Example 2:
Input:
N = 4
arr[] = {1, 2, 6, 5}
Output: 2
Explanation: We can take 6 cookies from the 3rd bowl
and put them into 1st bowl, now the array becomes
{7, 2, 0, 5}. We discard the 3rd array as it becomes
empty. Hence, arr={7, 2, 5}. Now, we take 5 cookies
from 3rd bowl and put them into the 2nd bowl. Hence
arr={7, 7, 0}. Discarding 3rd empty bowl, number of
bowls containing identical number of cookies i.e 7 is 2.
Your Task:
You don't need to read input or print anything. Your task is to complete the function getMaximum() which takes the array arr[] and its size N as input parameters and returns the maximum number of bowls we can have with an identical number of cookies.
Expected Time Complexity: O(N)
Expected Auxiliary Space: O(1)
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/5bfe93cc7f5a214bc6342709c78bc3dceba0f1c1/1
Powered by hirist.com
"Maximum Identical Bowls"
Solve the problem to win points
There are N bowls containing cookies. In one operation, you can take one cookie from any of the non-empty bowls and put it into another bowl. If the bowl becomes empty you discard it. You can perform the above operation any number of times. You want to know the maximum number of bowls you can have with an identical number of cookies.
Note: All the non-discarded bowls should contain the identical number of cookies.
Example 1:
Input:
N = 3
arr[] = {3, 1, 5}
Output: 3
Explanation: We can put 2 cookies from the 3rd bowl
and put them into the 2nd bowl.Now the array
becomes {3, 3, 3}. Each bowl now contains 3 cookies.
Example 2:
Input:
N = 4
arr[] = {1, 2, 6, 5}
Output: 2
Explanation: We can take 6 cookies from the 3rd bowl
and put them into 1st bowl, now the array becomes
{7, 2, 0, 5}. We discard the 3rd array as it becomes
empty. Hence, arr={7, 2, 5}. Now, we take 5 cookies
from 3rd bowl and put them into the 2nd bowl. Hence
arr={7, 7, 0}. Discarding 3rd empty bowl, number of
bowls containing identical number of cookies i.e 7 is 2.
Your Task:
You don't need to read input or print anything. Your task is to complete the function getMaximum() which takes the array arr[] and its size N as input parameters and returns the maximum number of bowls we can have with an identical number of cookies.
Expected Time Complexity: O(N)
Expected Auxiliary Space: O(1)
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/5bfe93cc7f5a214bc6342709c78bc3dceba0f1c1/1
Powered by hirist.com
practice.geeksforgeeks.org
Maximum Identical Bowls | Practice | GeeksforGeeks
There are N bowls containing cookies. In one operation, you can take one cookie from any of the non-empty bowls and put it into another bowl. If the bowl becomes empty you discard it. You can perform the above operation any number of times. You want
π1
Must Learn!π‘
React App is a web or mobile application that is built using the React library of JavaScript.
Deployment of a React app can be done via GitHub, Netlify, or any other deployment platform.
This article talks about the deployment of React App usin Github. Give it a read.
Link- https://www.geeksforgeeks.org/how-to-deploy-react-app-on-netlify-using-github/?utm_sour[β¦]rketingteam_gfgmain&utm_campaign=deployreactappusinggithub
React App is a web or mobile application that is built using the React library of JavaScript.
Deployment of a React app can be done via GitHub, Netlify, or any other deployment platform.
This article talks about the deployment of React App usin Github. Give it a read.
Link- https://www.geeksforgeeks.org/how-to-deploy-react-app-on-netlify-using-github/?utm_sour[β¦]rketingteam_gfgmain&utm_campaign=deployreactappusinggithub
π2
π¨Job Alertπ¨
GeeksforGeeks is hiring for Technical Content Engineer(Data Science).
Location - Noida
Experience - Internship
Apply by - Jun 19, 2023
Apply via the following link and share the opportunity with your friends- https://www.geeksforgeeks.org/jobs/geeksforgeeks-tcedata-3036?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=geeksforgeeks-tcedata-3036
π’: Also, do not miss the chance to get endless opportunities at Jobs Fair 2023 (Exclusively for Students) - https://www.geeksforgeeks.org/jobs?tab=studentjobfair
GeeksforGeeks is hiring for Technical Content Engineer(Data Science).
Location - Noida
Experience - Internship
Apply by - Jun 19, 2023
Apply via the following link and share the opportunity with your friends- https://www.geeksforgeeks.org/jobs/geeksforgeeks-tcedata-3036?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=geeksforgeeks-tcedata-3036
π’: Also, do not miss the chance to get endless opportunities at Jobs Fair 2023 (Exclusively for Students) - https://www.geeksforgeeks.org/jobs?tab=studentjobfair
π4
Problem Of The Day
"Expression Add Operators"
Solve the problem to win points
Given a string S that contains only digits (0-9) and an integer target, return all possible strings to insert the binary operator ' + ', ' - ', or ' * ' between the digits of S so that the resultant expression evaluates to the target value.
Note: Operands in the returned expressions should not contain leading zeros. For example, 2 + 03 is not allowed whereas 20 + 3 is fine. It is allowed to not insert any of the operators.
Example 1:
Input:
S = "123"
target = 6
Output: { "1*2*3", "1+2+3"}
Explanation: Both "1*2*3" and "1+2+3" evaluate to 6.
Example 2:
Input:
S = "3456237490"
target = 9191
Output: { }
Explanation: There are no expressions that can be created from "3456237490" to evaluate to 9191.
Example 3:
Input:
S = "12"
target = 12
Output: { "12"}
Explanation: S itself matches the target. No other strings are possible.
Your Task:
You don't need to read input or print anything. Your task is to complete the function addOperators() which takes string S and integer target as parameters and returns a list of strings that contains all valid possibilities.
Expected Time Complexity: O(|S|*4|S|)
Expected Auxiliary Space: O(|s|*3|S|)
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/expression-add-operators/1
Powered by hirist.com
"Expression Add Operators"
Solve the problem to win points
Given a string S that contains only digits (0-9) and an integer target, return all possible strings to insert the binary operator ' + ', ' - ', or ' * ' between the digits of S so that the resultant expression evaluates to the target value.
Note: Operands in the returned expressions should not contain leading zeros. For example, 2 + 03 is not allowed whereas 20 + 3 is fine. It is allowed to not insert any of the operators.
Example 1:
Input:
S = "123"
target = 6
Output: { "1*2*3", "1+2+3"}
Explanation: Both "1*2*3" and "1+2+3" evaluate to 6.
Example 2:
Input:
S = "3456237490"
target = 9191
Output: { }
Explanation: There are no expressions that can be created from "3456237490" to evaluate to 9191.
Example 3:
Input:
S = "12"
target = 12
Output: { "12"}
Explanation: S itself matches the target. No other strings are possible.
Your Task:
You don't need to read input or print anything. Your task is to complete the function addOperators() which takes string S and integer target as parameters and returns a list of strings that contains all valid possibilities.
Expected Time Complexity: O(|S|*4|S|)
Expected Auxiliary Space: O(|s|*3|S|)
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/expression-add-operators/1
Powered by hirist.com
www.geeksforgeeks.org
Expression Add Operators | Practice | GeeksforGeeks
Given a string S that contains only digits (0-9) and an integer target, return all possible strings to insert the binary operator ' + ', ' - ', or ' * ' between the digits of S so that the resultant expression evaluates to the target value.
π3
Must Learn!π‘
Search engine optimizationβs (SEO) typical to practice for contemporary e-commerce platforms to use keywords to grab the interest of web search bots like Google.
To improve e-commerce SEO methods, technical SEO digs deeper into the server and code. It enhances SEO by optimizing a siteβs technical features, like page load times.
In this article, weβll provide you with a detailed explanation of technical SEO. Give it a read.
Link- https://www.geeksforgeeks.org/what-is-technical-seo/?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=technicalseo
Search engine optimizationβs (SEO) typical to practice for contemporary e-commerce platforms to use keywords to grab the interest of web search bots like Google.
To improve e-commerce SEO methods, technical SEO digs deeper into the server and code. It enhances SEO by optimizing a siteβs technical features, like page load times.
In this article, weβll provide you with a detailed explanation of technical SEO. Give it a read.
Link- https://www.geeksforgeeks.org/what-is-technical-seo/?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=technicalseo
π1
π¨Job Alertπ¨
Instient is hiring for Junior Software Engineer.
Location - Remote
Experience - Fresher
Apply by - Jun 22, 2023
Apply via the following link and share the opportunity with your friends- https://www.geeksforgeeks.org/jobs/instient-pvt-ltd-junior-software-engineer?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=instient-pvt-ltd-junior-software-engineer
π’: Also, do not miss the chance to get endless opportunities at Jobs Fair 2023 (Exclusively for Students) - https://www.geeksforgeeks.org/jobs?tab=studentjobfair
Instient is hiring for Junior Software Engineer.
Location - Remote
Experience - Fresher
Apply by - Jun 22, 2023
Apply via the following link and share the opportunity with your friends- https://www.geeksforgeeks.org/jobs/instient-pvt-ltd-junior-software-engineer?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=instient-pvt-ltd-junior-software-engineer
π’: Also, do not miss the chance to get endless opportunities at Jobs Fair 2023 (Exclusively for Students) - https://www.geeksforgeeks.org/jobs?tab=studentjobfair
Problem Of The Day
"Express as sum of power of natural numbers"
Solve the problem to win points
Given two numbers n and x, find out the total number of ways n can be expressed as the sum of the Xth power of unique natural numbers. As the total number of ways can be very large, so return the number of ways modulo 109 + 7.
Example 1:
Input:
n = 10, x = 2
Output:
1
Explanation:
10 = 12 + 32, Hence total 1 possibility.
Example 2:
Input:
n = 100, x = 2
Output:
3
Explanation:
100 = 102
62 + 82 and 12 + 32 + 42 + 52 + 72
Hence total 3 possibilities.
Your Task:
You don't need to read input or print anything. Complete the function numOfWays() which takes n and x as input parameters and returns the total number of ways n can be expressed as the sum of xth power of unique natural numbers.
Expected Time Complexity: O(n2logn)
Expected Auxiliary Space: O(n)
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/express-as-sum-of-power-of-natural-numbers5647/1
Powered by hirist.com
"Express as sum of power of natural numbers"
Solve the problem to win points
Given two numbers n and x, find out the total number of ways n can be expressed as the sum of the Xth power of unique natural numbers. As the total number of ways can be very large, so return the number of ways modulo 109 + 7.
Example 1:
Input:
n = 10, x = 2
Output:
1
Explanation:
10 = 12 + 32, Hence total 1 possibility.
Example 2:
Input:
n = 100, x = 2
Output:
3
Explanation:
100 = 102
62 + 82 and 12 + 32 + 42 + 52 + 72
Hence total 3 possibilities.
Your Task:
You don't need to read input or print anything. Complete the function numOfWays() which takes n and x as input parameters and returns the total number of ways n can be expressed as the sum of xth power of unique natural numbers.
Expected Time Complexity: O(n2logn)
Expected Auxiliary Space: O(n)
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/express-as-sum-of-power-of-natural-numbers5647/1
Powered by hirist.com
www.geeksforgeeks.org
Express as sum of power of natural numbers | Practice | GeeksforGeeks
Given two numbers n and x, find out the total number of ways n can be expressed as the sum of the Xth power of unique natural numbers. As the total number of ways can be very large, so return the number of ways modulo 109 + 7.
Ex
Ex
π2
Must Learn!π‘
If youβre looking around you, people now started using AI websites and apps. Itβs true that the AI era has started and boomed since the launch of ChatGPT.
In this article, we will talk about 7 secret AI websites that you probably never heard of but these can boost your productivity like anything. Give it a read.
Link- https://www.geeksforgeeks.org/secret-ai-websites-you-probably-didnt-know-existed/?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=secretaiwebsites
If youβre looking around you, people now started using AI websites and apps. Itβs true that the AI era has started and boomed since the launch of ChatGPT.
In this article, we will talk about 7 secret AI websites that you probably never heard of but these can boost your productivity like anything. Give it a read.
Link- https://www.geeksforgeeks.org/secret-ai-websites-you-probably-didnt-know-existed/?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=secretaiwebsites
π1
Problem Of The Day
"Modify Linked List-1"
Solve the problem to win points
Given a singly linked list containing N nodes. Modify the Linked list as follows:
1. Modify the value of the first half nodes such that 1st node's new value is equal to the value of the last node minus the first node's current value, 2nd node's new value is equal to the second last nodes value minus 2nd nodes current value, likewise for first half nodes.
2. Replace the second half of nodes with the initial values of the first half nodes(values before modifying the nodes).
3. If N is odd then the value of the middle node remains unchanged.
Example 1:
Input:
N = 5
linked list = 10 -> 4 -> 5 -> 3 -> 6
Output:
-4 -1 5 4 10
Explanation:
For first half nodes modified list will be:
-4 -> -1 -> 5 -> 3 -> 6
For second half nodes modified list will be:
-4 -> -1 -> 5 -> 4 -> 10
Example 2:
Input:
N = 6
linked list = 2 -> 9 -> 8 -> 12 -> 7 -> 10
Output:
8 -2 4 8 9 2
Explanation:
After modifying the linked list as required,
we have a new linked list containing the elements as
8 -> -2 -> 4 -> 8 -> 9 -> 2.
YourTask:
The task is to complete the function modifyTheList() which should modify the list as required.
Expected Time Complexity: O(N)
Expected Auxiliary Space: O(1)
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/modify-linked-list-1-0546/1
Powered by hirist.com
"Modify Linked List-1"
Solve the problem to win points
Given a singly linked list containing N nodes. Modify the Linked list as follows:
1. Modify the value of the first half nodes such that 1st node's new value is equal to the value of the last node minus the first node's current value, 2nd node's new value is equal to the second last nodes value minus 2nd nodes current value, likewise for first half nodes.
2. Replace the second half of nodes with the initial values of the first half nodes(values before modifying the nodes).
3. If N is odd then the value of the middle node remains unchanged.
Example 1:
Input:
N = 5
linked list = 10 -> 4 -> 5 -> 3 -> 6
Output:
-4 -1 5 4 10
Explanation:
For first half nodes modified list will be:
-4 -> -1 -> 5 -> 3 -> 6
For second half nodes modified list will be:
-4 -> -1 -> 5 -> 4 -> 10
Example 2:
Input:
N = 6
linked list = 2 -> 9 -> 8 -> 12 -> 7 -> 10
Output:
8 -2 4 8 9 2
Explanation:
After modifying the linked list as required,
we have a new linked list containing the elements as
8 -> -2 -> 4 -> 8 -> 9 -> 2.
YourTask:
The task is to complete the function modifyTheList() which should modify the list as required.
Expected Time Complexity: O(N)
Expected Auxiliary Space: O(1)
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/modify-linked-list-1-0546/1
Powered by hirist.com
practice.geeksforgeeks.org
Modify Linked List-1 | Practice | GeeksforGeeks
Given a singly linked list containing N nodes. Modify the Linked list as follows:
1. Modify the value of the first half nodes such that 1st node's new value is equal to the value of the last node minus the first node's current value, 2
1. Modify the value of the first half nodes such that 1st node's new value is equal to the value of the last node minus the first node's current value, 2
π3
π¨Job Alertπ¨
SkyAch is hiring for Software Developer.
Location - Mohali (Work From Office)
Experience - Fresher
Apply by - May 31, 2023
Apply via the following link and share the opportunity with your friends- https://www.geeksforgeeks.org/jobs/skyach-software-developer?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=skyach-software-developer
SkyAch is hiring for Software Developer.
Location - Mohali (Work From Office)
Experience - Fresher
Apply by - May 31, 2023
Apply via the following link and share the opportunity with your friends- https://www.geeksforgeeks.org/jobs/skyach-software-developer?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=skyach-software-developer
β€1