Must Learn!💡
The process of discovering patterns and relationships in large datasets using machine learning and statistical analysis is called 'Data Mining'. It helps organizations keep a track of insights based on industry.
So, how is it done?
This article talks about data mining in detail. Give it a read.
Link - https://www.geeksforgeeks.org/what-is-data-mining-a-complete-beginners-guide/
The process of discovering patterns and relationships in large datasets using machine learning and statistical analysis is called 'Data Mining'. It helps organizations keep a track of insights based on industry.
So, how is it done?
This article talks about data mining in detail. Give it a read.
Link - https://www.geeksforgeeks.org/what-is-data-mining-a-complete-beginners-guide/
Problem Of The Day
"Prime List"
Solve the problem to win points
You are given the head of a linked list. You have to replace all the values of the nodes with the nearest prime number. If more than one prime number exists at an equal distance, choose the smallest one.
Example 1:
Input:
2 → 6 → 10
Output:
2 → 5 → 11
Explanation:
The nearest prime of 2 is 2 itself.
The nearest primes of 6 are 5 and 7,
since 5 is smaller so, 5 will be chosen.
The nearest prime of 10 is 11.
Example 2:
Input:
1 → 15 → 20
Output:
2 → 13 → 19
Explanation:
The nearest prime of 1 is 2.
The nearest primes of 15 are 13 and 17,
since 13 is smaller so, 13 will be chosen.
The nearest prime of 20 is 19.
Your Task:
The task is to complete the function primeList() which contains a reference to the head as the only argument. This function should return the head of the modified linked list.
Expected Time Complexity: O(number of nodes * sqrt(value of node)).
Expected Auxiliary Space: O(1).
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/6cb0782855c0f11445b8d70e220f888e6ea8e22a/1
Powered by hirist.com
"Prime List"
Solve the problem to win points
You are given the head of a linked list. You have to replace all the values of the nodes with the nearest prime number. If more than one prime number exists at an equal distance, choose the smallest one.
Example 1:
Input:
2 → 6 → 10
Output:
2 → 5 → 11
Explanation:
The nearest prime of 2 is 2 itself.
The nearest primes of 6 are 5 and 7,
since 5 is smaller so, 5 will be chosen.
The nearest prime of 10 is 11.
Example 2:
Input:
1 → 15 → 20
Output:
2 → 13 → 19
Explanation:
The nearest prime of 1 is 2.
The nearest primes of 15 are 13 and 17,
since 13 is smaller so, 13 will be chosen.
The nearest prime of 20 is 19.
Your Task:
The task is to complete the function primeList() which contains a reference to the head as the only argument. This function should return the head of the modified linked list.
Expected Time Complexity: O(number of nodes * sqrt(value of node)).
Expected Auxiliary Space: O(1).
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/6cb0782855c0f11445b8d70e220f888e6ea8e22a/1
Powered by hirist.com
practice.geeksforgeeks.org
Prime List | Practice | GeeksforGeeks
You are given the head of a linked list. You have to replace all the values of the nodes with the nearest prime number. If more than one prime number exists at an equal distance, choose the smallest one.
Example 1:
Input:
2 → 6 → 1
Example 1:
Input:
2 → 6 → 1
👍2
🚨Job Alert🚨
Plasma is hiring for Full Stack Developer.
Location - Noida
Experience - 3-6 Years
Apply by - Feb 28, 2023
Apply via the following link and share the opportunity with your friends - https://practice.geeksforgeeks.org/jobs/plasma-fullstack-devs-exp?utm_source=discord&utm_medium=marketingteam_gfgmain&utm_campaign=plasmafullstackdevsexp
Visit our jobs portal 'Get Hired With GeeksforGeeks' for more such job opportunities - https://practice.geeksforgeeks.org/jobs
Plasma is hiring for Full Stack Developer.
Location - Noida
Experience - 3-6 Years
Apply by - Feb 28, 2023
Apply via the following link and share the opportunity with your friends - https://practice.geeksforgeeks.org/jobs/plasma-fullstack-devs-exp?utm_source=discord&utm_medium=marketingteam_gfgmain&utm_campaign=plasmafullstackdevsexp
Visit our jobs portal 'Get Hired With GeeksforGeeks' for more such job opportunities - https://practice.geeksforgeeks.org/jobs
Must Learn!💡
We all use Instagram and who doesn't like to get likes, comments, and better reach on the platform? However, we struggle because we don't know the right upload time.
So, what is the best time to post on Instagram?
Don't worry! We got your back. This article will help you understand the same. Give it a read.
Link - https://www.geeksforgeeks.org/best-time-to-post-on-instagram/
We all use Instagram and who doesn't like to get likes, comments, and better reach on the platform? However, we struggle because we don't know the right upload time.
So, what is the best time to post on Instagram?
Don't worry! We got your back. This article will help you understand the same. Give it a read.
Link - https://www.geeksforgeeks.org/best-time-to-post-on-instagram/
Problem Of The Day
"Arithmetic Number"
Solve the problem to win points
Given three integers 'A' denoting the first term of an arithmetic sequence , 'C' denoting the common difference of an arithmetic sequence and an integer 'B'. you need to tell whether 'B' exists in the arithmetic sequence or not. Return 1 if B is present in the sequence. Otherwise, returns 0.
Example 1:
Input: A = 1, B = 3, C = 2
Output: 1
Explaination: 3 is the second term of the
sequence starting with 1 and having a common
difference 2.
Example 2:
Input: A = 1, B = 2, C = 3
Output: 0
Explaination: 2 is not present in the sequence.
Your Task:
You do not need to read input or print anything. Your task is to complete the function inSequence() which takes A, B and C and returns 1 if B is present in the sequence. Otherwise, returns 0.
Expected Time Complexity: O(1)
Expected Auxiliary Space: O(1)
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/arithmetic-number2815/1
Powered by hirist.com
"Arithmetic Number"
Solve the problem to win points
Given three integers 'A' denoting the first term of an arithmetic sequence , 'C' denoting the common difference of an arithmetic sequence and an integer 'B'. you need to tell whether 'B' exists in the arithmetic sequence or not. Return 1 if B is present in the sequence. Otherwise, returns 0.
Example 1:
Input: A = 1, B = 3, C = 2
Output: 1
Explaination: 3 is the second term of the
sequence starting with 1 and having a common
difference 2.
Example 2:
Input: A = 1, B = 2, C = 3
Output: 0
Explaination: 2 is not present in the sequence.
Your Task:
You do not need to read input or print anything. Your task is to complete the function inSequence() which takes A, B and C and returns 1 if B is present in the sequence. Otherwise, returns 0.
Expected Time Complexity: O(1)
Expected Auxiliary Space: O(1)
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/arithmetic-number2815/1
Powered by hirist.com
www.geeksforgeeks.org
Arithmetic Number | Practice | GeeksforGeeks
Given three integers 'A' denoting the first term of an arithmetic sequence , 'C' denoting the common difference of an arithmetic sequence and an integer 'B'. you need to tell whether 'B' exists in the arithm
👍2
Must Learn!💡
C++ is considered a powerful, versatile, and compiled language that means, source code is converted into machine language before execution.
So, how can you use C++ in much advanced manner?
This article talks about 10 tricks of C++ that you should know to enhance your programming skills. Give it a read.
Link- https://www.geeksforgeeks.org/10-cpp-programming-tricks-that-you-should-know/?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=cppprogrammingtricks
C++ is considered a powerful, versatile, and compiled language that means, source code is converted into machine language before execution.
So, how can you use C++ in much advanced manner?
This article talks about 10 tricks of C++ that you should know to enhance your programming skills. Give it a read.
Link- https://www.geeksforgeeks.org/10-cpp-programming-tricks-that-you-should-know/?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=cppprogrammingtricks
👍4
Problem Of The Day
"Walls Coloring"
Solve the problem to win points
There is a row of N walls in Geeksland. The king of Geeksland ordered Alexa to color all the walls on the occasion of New Year. Alexa can color each wall with either pink, black, or yellow. The cost associated with coloring each wall with a particular color is represented by a 2D array colors of size N*3 , where colors[i][0], colors[i][1], and colors[i][2] is the cost of painting ith wall with colors pink, black, and yellow respectively.
You need to find the minimum cost to color all the walls such that no two adjacent walls have the same color.
Example 1:
Input:
N = 3
colors[][] = {{14, 2, 11},
{11, 14, 5},
{14, 3, 10}}
Output:
10
Explanation:
Color wall 0 with black. Cost = 2.
Color wall 1 with yellow. Cost = 5.
Color wall 2 with black. Cost = 3.
Total Cost = 2 + 5 + 3 = 10
Example 2:
Input:
N = 2
colors[][] = {{1, 2, 3},
{1, 4, 6}}
Output:
3
Explanation:
Color wall 0 with black. Cost = 2
Color wall 1 with pink. Cost = 1
Total Cost = 1 + 2 = 3
Your Task:
Your task is to complete the function minCost() which takes the 2D integer array colors and an integer N as the input parameters and returns an integer, representing the minimum cost to color all the walls.
Expected Time Complexity: O(N).
Expected Auxiliary Space: O(N).
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/51b266505221b97522b1d2c86ddad1868a54831b/1
Powered by hirist.com
"Walls Coloring"
Solve the problem to win points
There is a row of N walls in Geeksland. The king of Geeksland ordered Alexa to color all the walls on the occasion of New Year. Alexa can color each wall with either pink, black, or yellow. The cost associated with coloring each wall with a particular color is represented by a 2D array colors of size N*3 , where colors[i][0], colors[i][1], and colors[i][2] is the cost of painting ith wall with colors pink, black, and yellow respectively.
You need to find the minimum cost to color all the walls such that no two adjacent walls have the same color.
Example 1:
Input:
N = 3
colors[][] = {{14, 2, 11},
{11, 14, 5},
{14, 3, 10}}
Output:
10
Explanation:
Color wall 0 with black. Cost = 2.
Color wall 1 with yellow. Cost = 5.
Color wall 2 with black. Cost = 3.
Total Cost = 2 + 5 + 3 = 10
Example 2:
Input:
N = 2
colors[][] = {{1, 2, 3},
{1, 4, 6}}
Output:
3
Explanation:
Color wall 0 with black. Cost = 2
Color wall 1 with pink. Cost = 1
Total Cost = 1 + 2 = 3
Your Task:
Your task is to complete the function minCost() which takes the 2D integer array colors and an integer N as the input parameters and returns an integer, representing the minimum cost to color all the walls.
Expected Time Complexity: O(N).
Expected Auxiliary Space: O(N).
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/51b266505221b97522b1d2c86ddad1868a54831b/1
Powered by hirist.com
practice.geeksforgeeks.org
Walls Coloring | Practice | GeeksforGeeks
There is a row of N walls in Geeksland. The king of Geeksland ordered Alexa to color all the walls on the occasion of New Year. Alexa can color each wall with either pink, black, or yellow. The cost associated with coloring each wall with a
👍1
Must Learn!💡
JavaScript is by far of the most popular languages when it comes to web development, powering most websites and web applications.
So, what are the code snippets you must know about JavaScript?
This article deals with the forementioned question in detail. Give it a read.
Link- https://www.geeksforgeeks.org/javascript-code-snippets-that-every-developer-must-know/?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=javascriptcodesnippets
JavaScript is by far of the most popular languages when it comes to web development, powering most websites and web applications.
So, what are the code snippets you must know about JavaScript?
This article deals with the forementioned question in detail. Give it a read.
Link- https://www.geeksforgeeks.org/javascript-code-snippets-that-every-developer-must-know/?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=javascriptcodesnippets
👍4
🚨Job Alert🚨
NCode Technologies is hiring for Laravel Developer.
Location - Ahmedabad, Gujarat
Experience - 2+ Years
Apply by - Feb 28, 2023
Apply via the following link and share the opportunity with your friends - https://practice.geeksforgeeks.org/jobs/NCode-Laravel?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=NCode-Laravel
Visit our jobs portal 'Get Hired With GeeksforGeeks' for more such job opportunities - https://practice.geeksforgeeks.org/jobs
NCode Technologies is hiring for Laravel Developer.
Location - Ahmedabad, Gujarat
Experience - 2+ Years
Apply by - Feb 28, 2023
Apply via the following link and share the opportunity with your friends - https://practice.geeksforgeeks.org/jobs/NCode-Laravel?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=NCode-Laravel
Visit our jobs portal 'Get Hired With GeeksforGeeks' for more such job opportunities - https://practice.geeksforgeeks.org/jobs
Problem Of The Day
"Geeks Island"
Solve the problem to win points
Geeks Island is represented by an N * M matrix mat. The island is touched by the Indian Ocean from the top and left edges and the Arabian Sea from the right and bottom edges. Each element of the matrix represents the height of the cell.
Due to the rainy season, the island receives a lot of rainfall, and the water can flow in four directions(up, down, left, or right) from one cell to another one with height equal or lower.
You need to find the number of cells from where water can flow to both the Indian Ocean and the Arabian Sea.
Example 1:
Input:
N = 5, M = 5
mat[][] = {{1, 3, 3, 2, 4},
{4, 5, 6, 4, 4},
{2, 4, 5, 3, 1},
{6, 7, 1, 4, 5},
{6, 1, 1, 3, 4}}
Output:
8
Explanation:
Indian ~ ~ ~ ~ ~
Ocean ~ 1 3 3 2 (4) *
~ 4 5 (6) (4) (4) *
~ 2 4 (5) 3 1 *
~ (6) (7) 1 4 5 *
~ (6) 1 1 3 4 *
* * * * * Arabian Sea
Water can flow to both ocean and sea from the cells
denoted by parantheses().For example at index(1,2), the height of that island is 6. If a water drop falls on that island, water can flow to up direction(as 3<=6) and reach to Indian Ocean. ALso, water can flow to right direction(as 6>=4>=4) and reach to Arabian Sea.
Example 2:
Input:
N = 3, M = 2
mat[][] = {{1, 1, 1},
{1, 1, 1}}
Output:
6
Explanation:
Water can flow from all cells to both Indian Ocean and Arabian Sea as the height of all islands are same.
Your Task:
Your task is to complete the function water_flow() which takes an integer array mat, integer N and integer M as the input parameter and returns an integer, denoting the number of cells from which water can to both ocean and sea.
Expected Time Complexity : O(N*M)
Expected Auxiliary Space : O(N*M)
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/234ca3b438298fb04befd5abe7fbd98c006d4884/1
Powered by hirist.com
"Geeks Island"
Solve the problem to win points
Geeks Island is represented by an N * M matrix mat. The island is touched by the Indian Ocean from the top and left edges and the Arabian Sea from the right and bottom edges. Each element of the matrix represents the height of the cell.
Due to the rainy season, the island receives a lot of rainfall, and the water can flow in four directions(up, down, left, or right) from one cell to another one with height equal or lower.
You need to find the number of cells from where water can flow to both the Indian Ocean and the Arabian Sea.
Example 1:
Input:
N = 5, M = 5
mat[][] = {{1, 3, 3, 2, 4},
{4, 5, 6, 4, 4},
{2, 4, 5, 3, 1},
{6, 7, 1, 4, 5},
{6, 1, 1, 3, 4}}
Output:
8
Explanation:
Indian ~ ~ ~ ~ ~
Ocean ~ 1 3 3 2 (4) *
~ 4 5 (6) (4) (4) *
~ 2 4 (5) 3 1 *
~ (6) (7) 1 4 5 *
~ (6) 1 1 3 4 *
* * * * * Arabian Sea
Water can flow to both ocean and sea from the cells
denoted by parantheses().For example at index(1,2), the height of that island is 6. If a water drop falls on that island, water can flow to up direction(as 3<=6) and reach to Indian Ocean. ALso, water can flow to right direction(as 6>=4>=4) and reach to Arabian Sea.
Example 2:
Input:
N = 3, M = 2
mat[][] = {{1, 1, 1},
{1, 1, 1}}
Output:
6
Explanation:
Water can flow from all cells to both Indian Ocean and Arabian Sea as the height of all islands are same.
Your Task:
Your task is to complete the function water_flow() which takes an integer array mat, integer N and integer M as the input parameter and returns an integer, denoting the number of cells from which water can to both ocean and sea.
Expected Time Complexity : O(N*M)
Expected Auxiliary Space : O(N*M)
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/234ca3b438298fb04befd5abe7fbd98c006d4884/1
Powered by hirist.com
practice.geeksforgeeks.org
Geeks Island | Practice | GeeksforGeeks
Geeks Island is represented by an N * M matrix mat. The island is touched by the Indian Ocean from the top and left edges and the Arabian Sea from the right and bottom edges. Each element of the matrix represents the height of the cell
👍1
Boom! Job-A-Thon 17 is here... 🙌
Give a boost to your career, participate and win your dream opportunities.
Opportunities are just a click away... 💫
Register now - https://practice.geeksforgeeks.org/contest/job-a-thon-17-hiring-challenge?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=jobathon17
Give a boost to your career, participate and win your dream opportunities.
Opportunities are just a click away... 💫
Register now - https://practice.geeksforgeeks.org/contest/job-a-thon-17-hiring-challenge?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=jobathon17
Must Learn!💡
Razorpay helps process online payments for online as well as offline businesses. Razor pay allows you to accept credit cards, debit cards, net banking, wallet, and UPI payments with the Mobile App integration.
So, how will you integrate it using flutter?
This article deals with aforementioned questions and talks about the implementation of a payment gateway in our Flutter app. Give it a read.
Link- https://www.geeksforgeeks.org/how-to-integrate-razorpay-payment-gateway-in-flutter/?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=integraterazorpaypayment
Razorpay helps process online payments for online as well as offline businesses. Razor pay allows you to accept credit cards, debit cards, net banking, wallet, and UPI payments with the Mobile App integration.
So, how will you integrate it using flutter?
This article deals with aforementioned questions and talks about the implementation of a payment gateway in our Flutter app. Give it a read.
Link- https://www.geeksforgeeks.org/how-to-integrate-razorpay-payment-gateway-in-flutter/?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=integraterazorpaypayment
👍1
Problem Of The Day
"Good Stones"
Solve the problem to win points
Geek is in a geekland which have a river and some stones in it. Initially geek can step on any stone. Each stone has a number on it representing the value of exact step geek can move. If the number is +ve then geeks can move right and if the number is -ve then geeks can move left. Bad Stones are defined as the stones in which if geeks steps, will reach a never ending loop whereas good stones are the stones which are safe from never ending loops. Return the number of good stones in river.
Example 1:
Input: [2, 3, -1, 2, -2, 4, 1]
Output: 3
Explanation: Index 3, 5 and 6 are safe only. As index 1, 4, 2 forms a cycle and from index 0 you can go to index 2 which is part of cycle.
Example 2:
Input: [1, 0, -3, 0, -5, 0]
Output: 2
Explanation: Index 2 and 4 are safe only. As index 0, 1, 3, 5 form cycle.
Your Task:
You don't need to read input or print anything. Your task is to complete the function badStones() which takes integer n and an array arr as input, and return an interger value as the number of good stones. Here n is the lenght of arr.
Expected Time Complexity : O(N), N is the number of stones
Expected Auxiliary Space : O(N), N is the number of stones
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/e2d156755ca4e0a9b9abf5680191d4b06e52b1a8/1
Powered by hirist.com
"Good Stones"
Solve the problem to win points
Geek is in a geekland which have a river and some stones in it. Initially geek can step on any stone. Each stone has a number on it representing the value of exact step geek can move. If the number is +ve then geeks can move right and if the number is -ve then geeks can move left. Bad Stones are defined as the stones in which if geeks steps, will reach a never ending loop whereas good stones are the stones which are safe from never ending loops. Return the number of good stones in river.
Example 1:
Input: [2, 3, -1, 2, -2, 4, 1]
Output: 3
Explanation: Index 3, 5 and 6 are safe only. As index 1, 4, 2 forms a cycle and from index 0 you can go to index 2 which is part of cycle.
Example 2:
Input: [1, 0, -3, 0, -5, 0]
Output: 2
Explanation: Index 2 and 4 are safe only. As index 0, 1, 3, 5 form cycle.
Your Task:
You don't need to read input or print anything. Your task is to complete the function badStones() which takes integer n and an array arr as input, and return an interger value as the number of good stones. Here n is the lenght of arr.
Expected Time Complexity : O(N), N is the number of stones
Expected Auxiliary Space : O(N), N is the number of stones
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/e2d156755ca4e0a9b9abf5680191d4b06e52b1a8/1
Powered by hirist.com
www.geeksforgeeks.org
Good Stones | Practice | GeeksforGeeks
Geek is in a geekland which have a river and some stones in it. Initially geek can step on any stone. Each stone has a number on it representing the value of exact step geek can move. If the number is +ve then geeks can move right and if the number i
👍1
The details of Job-A-Thon 17 is out....🙌
AdvaRisk is hiring for Junior Data Engineer.
Experience - 1+ Years
Location - Pune
Register now - https://practice.geeksforgeeks.org/jobs/AdvaRisk-Junior-Data-Engineer-Job-A-Thon?utm_sourc[…]rketingteam_gfgmain&utm_campaign=AdvaRiskjuniorjobathon
AdvaRisk is hiring for Junior Data Engineer.
Experience - 1+ Years
Location - Pune
Register now - https://practice.geeksforgeeks.org/jobs/AdvaRisk-Junior-Data-Engineer-Job-A-Thon?utm_sourc[…]rketingteam_gfgmain&utm_campaign=AdvaRiskjuniorjobathon
This media is not supported in your browser
VIEW IN TELEGRAM
Must Learn!💡
An Application Programming Interface or an API is a set of definitions and protocols through which applications communicate with each other.'
So, what is the importance of API?
The process of connecting two or more software applications or processes using APIs is referred to as API integration.
This article talks about API and all its aspects in detail. Give it a read.
Link- https://www.geeksforgeeks.org/what-is-api-integration/?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=apiintegration
An Application Programming Interface or an API is a set of definitions and protocols through which applications communicate with each other.'
So, what is the importance of API?
The process of connecting two or more software applications or processes using APIs is referred to as API integration.
This article talks about API and all its aspects in detail. Give it a read.
Link- https://www.geeksforgeeks.org/what-is-api-integration/?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=apiintegration
Problem Of The Day
"Is it Fibonacci"
Solve the problem to win points
Geek just learned about Fibonacci numbers.
The Fibonacci Sequence is the series of numbers: 0, 1, 1, 2, 3, 5, 8, 13, ...
where the next number is found by adding up the two numbers before it.
He defines a new series called Geeky numbers. Here the next number is the sum of the K preceding numbers.
You are given an array of size K, GeekNum[ ], where the ith element of the array represents the ith Geeky number. Return its Nth term.
Note: This problem can be solved in O(N2) time complexity but the user has to solve this in O(N). The Constraints are less because there can be integer overflow in the terms.
Example 1:
Input:
N = 6, K = 1
GeekNum[] = {4}
Output:
4
Explanation:
Terms are 4, 4, 4, 4, 4, 4
Example 2:
Input:
N = 5, K = 3
GeekNum[] = {0, 1, 2}
Output:
6
Explanation:
Terms are 0, 1, 2, 3, 6.
So the 5th term is 6
Your Task:
You don't need to read input or print anything. Your task is to complete the function solve( ) which takes integer N, K, and an array GeekNum[] as input parameters and returns the Nth term of the Geeky series.
Expected Time Complexity: O(N)
Expected Space Complexity: O(N)
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/202d95ecdeec659401edc63dd952b1d37b989ab8/1
Powered by hirist.com
"Is it Fibonacci"
Solve the problem to win points
Geek just learned about Fibonacci numbers.
The Fibonacci Sequence is the series of numbers: 0, 1, 1, 2, 3, 5, 8, 13, ...
where the next number is found by adding up the two numbers before it.
He defines a new series called Geeky numbers. Here the next number is the sum of the K preceding numbers.
You are given an array of size K, GeekNum[ ], where the ith element of the array represents the ith Geeky number. Return its Nth term.
Note: This problem can be solved in O(N2) time complexity but the user has to solve this in O(N). The Constraints are less because there can be integer overflow in the terms.
Example 1:
Input:
N = 6, K = 1
GeekNum[] = {4}
Output:
4
Explanation:
Terms are 4, 4, 4, 4, 4, 4
Example 2:
Input:
N = 5, K = 3
GeekNum[] = {0, 1, 2}
Output:
6
Explanation:
Terms are 0, 1, 2, 3, 6.
So the 5th term is 6
Your Task:
You don't need to read input or print anything. Your task is to complete the function solve( ) which takes integer N, K, and an array GeekNum[] as input parameters and returns the Nth term of the Geeky series.
Expected Time Complexity: O(N)
Expected Space Complexity: O(N)
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/202d95ecdeec659401edc63dd952b1d37b989ab8/1
Powered by hirist.com
practice.geeksforgeeks.org
Is it Fibonacci | Practice | GeeksforGeeks
Geek just learned about Fibonacci numbers.
The Fibonacci Sequence is the series of numbers: 0, 1, 1, 2, 3, 5, 8, 13, ...
where the next number is found by adding up the two numbers before it.
He defines a new series called
The Fibonacci Sequence is the series of numbers: 0, 1, 1, 2, 3, 5, 8, 13, ...
where the next number is found by adding up the two numbers before it.
He defines a new series called
👍4
The details of Job-A-Thon 17 is out....🙌
Nimap Infotech is hiring for Dot Net Developer.
Experience - Freshers
Location - Mumbai
Register now - https://practice.geeksforgeeks.org/jobs/nimapinfotech-donet-job-a-thon?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=jobathon
Nimap Infotech is hiring for Dot Net Developer.
Experience - Freshers
Location - Mumbai
Register now - https://practice.geeksforgeeks.org/jobs/nimapinfotech-donet-job-a-thon?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=jobathon
👍1
Must Learn!💡
When we choose a profession, we have a number of doubts in our mind. Becoming a full stack developer is just like that.
So, what are the requirements to become a full stack developer?
This article will a great help you in order to know the requirements of becoming a full stack developer. Give it a read.
Link- https://www.geeksforgeeks.org/requirements-to-become-a-full-stack-developer?utm_source=discord&utm_medium=marketingteam_gfgmain&utm_campaign=fullstackdeveloper
When we choose a profession, we have a number of doubts in our mind. Becoming a full stack developer is just like that.
So, what are the requirements to become a full stack developer?
This article will a great help you in order to know the requirements of becoming a full stack developer. Give it a read.
Link- https://www.geeksforgeeks.org/requirements-to-become-a-full-stack-developer?utm_source=discord&utm_medium=marketingteam_gfgmain&utm_campaign=fullstackdeveloper
👍1
Problem Of The Day
"Apple Sequences"
Solve the problem to win points
Geek just learned about Fibonacci numbers.
There is a string of size n containing only 'A' and 'O'. 'A' stands for Apple, and 'O' stands for Orange. We have m number of spells, each spell allows us to convert an orange into an apple.
Find the longest sequence of apples you can make, given a string and the value of m.
Example 1:
Input:
N = 5
M = 1
arr[] = 'AAOAO'
Output: 4
Explanation: Changing the orange at
3rd position into an apple gives
us the maximum possible answer.
Example 2:
Input:
N = 5
M = 1
arr = 'AOOAO'
Output: 2
Explanation: Changing any orange into
an apple will give us a sequence
of length 2.
Your Task:
You don't need to read input or print anything. Your task is to complete the function appleSequence() which takes the array in the form of a string, its size n, and an integer m as input parameters and returns the largest apple sequences after converting m oranges.
Expected Time Complexity: O(n)
Expected Auxiliary Space: O(1)
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/38f100615d0b2efa755e7b07f905e0f8cd2fe5df/1
Powered by hirist.com
"Apple Sequences"
Solve the problem to win points
Geek just learned about Fibonacci numbers.
There is a string of size n containing only 'A' and 'O'. 'A' stands for Apple, and 'O' stands for Orange. We have m number of spells, each spell allows us to convert an orange into an apple.
Find the longest sequence of apples you can make, given a string and the value of m.
Example 1:
Input:
N = 5
M = 1
arr[] = 'AAOAO'
Output: 4
Explanation: Changing the orange at
3rd position into an apple gives
us the maximum possible answer.
Example 2:
Input:
N = 5
M = 1
arr = 'AOOAO'
Output: 2
Explanation: Changing any orange into
an apple will give us a sequence
of length 2.
Your Task:
You don't need to read input or print anything. Your task is to complete the function appleSequence() which takes the array in the form of a string, its size n, and an integer m as input parameters and returns the largest apple sequences after converting m oranges.
Expected Time Complexity: O(n)
Expected Auxiliary Space: O(1)
Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/38f100615d0b2efa755e7b07f905e0f8cd2fe5df/1
Powered by hirist.com
practice.geeksforgeeks.org
Apple Sequences | Practice | GeeksforGeeks
There is a string of size n containing only 'A' and 'O' . 'A' stands for Apple, 'O' stands for Orange. We have m number of spells, each spell allows us to convert an orange into an apple.
👍2
The details of Job-A-Thon 17 is out....🙌
Avi Software is hiring for Software Developer.
Experience - Freshers
Location - Mohali
Register now - https://practice.geeksforgeeks.org/jobs/AviSoftware-SDE-Job-a-thon?
Avi Software is hiring for Software Developer.
Experience - Freshers
Location - Mohali
Register now - https://practice.geeksforgeeks.org/jobs/AviSoftware-SDE-Job-a-thon?