GeeksforGeeks
19.1K subscribers
1.66K photos
34 videos
24 files
2.63K links
Official Hub βœ…

Your coding haven – where tech meets simplicity.

Discover:
πŸ˜‚ Coding Laughter
πŸ“˜ Curated Study Material
πŸ’Ž Exclusive Offers

Utilize every service we provide and make a promise to find better opportunities for yourself! #gfgkarlohojayega!
Download Telegram
Must Learn!πŸ’‘
Adobe Dreamweaver is among the finest platform where you can create webpages, and that too with multiple language support (such as HTML, CSS, JavaScript, etc.).

The tool and functions of this platform allow users to create more responsive designs that can perform well on all devices, such as Mobile, Tablet, Desktop, etc.

This article will introduce you with the 10 best dreamweaver alternativeas in Linux. Give it a read.

Link- https://www.geeksforgeeks.org/10-best-adobe-dreamweaver-alternatives-for-linux/?utm_sou[…]medium=marketingteam_gfgmain&utm_campaign=adobedreamweaver
πŸ‘1πŸ‘Ž1
Problem Of The Day
"Geek hates too many 1s"

Solve the problem to win points

Given an non-negative integer n. You are only allowed to make set bit unset. You have to find the maximum possible value of query so that after performing the given operations, no three consecutive bits of the integer query are set-bits.

Example 1:
Input:
n = 2
Output:
2
Explanation:
2's binary form is 10, no 3 consecutive set bits are here.
So, 2 itself would be answer.

Example 2:
Input:
n = 7
Output:
6
Explanation:
7's binary form is .....00111.We can observe that 3
consecutive bits are set bits. This is not allowed.
So, we can perfrom the operation of changing set
bit to unset bit. Now, the number
becomes 6 that is .....00110. It satifies the
given condition. Hence, the maximum possible
value is 6.

Your Task: You don't need to read input or print anything. Your task is to complete the function noConseBits(), which takes integer n as input parameter and returns the maximum value possible so that it satifies the given condition.

Expected Time Complexity: O(1)
Expected Auxiliary Space: O(1)

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/07e45fe40846bc670ad2507d2c649304699768b9/1

Powered by hirist.com
❀1πŸ‘Ž1
Making your first move for your career is much easier with a range of opportunities at Jobs Fair 2023.✨ Till 20th March...!

Don't wait...Hurry up!

This is the right time and right move to kickstart your career.πŸ˜ƒπŸ€Œ

Get hired - https://practice.geeksforgeeks.org/jobs?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=jobfair2023
πŸ‘1πŸ‘Ž1
Must Learn!πŸ’‘
If you are an aspiring Java Developer, then you must be aware of the fact that it is one of the sought-after domains nowadays.

While it is among popular programming language, it is becoming advanced with each passing year. Being a developer you must update yourself along.

This article talks about the top 12 Java developer skills that you as a programmer, must have in 2023. Give it a read.

Link- https://www.geeksforgeeks.org/top-12-java-developer-skills-that-you-must-have/?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=javadevelopers
❀1πŸ‘Ž1
Problem Of The Day
"Max Level Sum in Binary Tree"

Solve the problem to win points

Given a Binary Tree having positive and negative nodes. Find the maximum sum of a level in the given Binary Tree.

Example 1:
Input :
4
/ \
2 -5
/ \ / \
-1 3 -2 6

Output: 6

Explanation :
Sum of all nodes of 0'th level is 4
Sum of all nodes of 1'th level is -3
Sum of all nodes of 2'th level is 6
Hence maximum sum is 6

Example 2:
Input :
1
/ \
2 3
/ \ \
4 5 8
/ \
6 7

Output : 17

Explanation: Maximum sum is at level 2.

Your Task:
You dont need to read input or print anything. Complete the function maxLevelSum() which takes root node as input parameter and returns the maximum sum of any horizontal level in the given Binary Tree.

Expected Time Complexity: O(N), where N is no of node.
Expected Auxiliary Space: O(W), Where W is the max width of the tree.

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/4b7ff87c26ed23b3f63c25c611690213d44fb6aa/1

Powered by hirist.com
❀1πŸ‘Ž1
Must Learn!πŸ’‘
AI or Artificial Intelligence is the most-talked topic and the entry of ChatGPT and Google Bard has left people stunned.

These AI tools are capable of doing anything and any work, from giving answers to each question, making taglines to solving papers.

It's complicated to choose between both the tool and indentify the difference between them. However, there are significant differences between ChatGPT and Google Bard.

This article talks about both the tools, their utilities, and difference between them in detail. Give it a read.

Link- https://www.geeksforgeeks.org/chatgpt-vs-google-bard-top-differences-that-you-should-know/?utm_source=Telegram&utm_medium=marketingteam_gfgmain&utm_campaign=chatgpt-googlebard
Problem Of The Day
"Max min Height"

Solve the problem to win points

You have a garden with n flowers lined up in a row. The height of ith flower is ai units. You will water them for k days. In one day you can water w continuous flowers (you can do this only once in a single day). Whenever you water a flower its height increases by 1 unit. You need to maximize the height of the smallest flower all the time.

Example 1:
Input:
n=6
k=2
w=3
a[]={2,2,2,2,1,1}
Output:
2
Explanation:
Water last three flowers for first day &
first three flowers for second day.The
new heights will be {3,3,3,3,2,2}

Example 2:
Input:
n=2
k=5
w=1
a[]={5,8}
Output:
9
Explanation:
For the first four days water the first flower then
water the last flower once.
Your Task:
You don't need to read input or print anything. Your task is to complete the function maximizeMinHeight() which takes the array a[], its size N, integer K, and an integer W as input parameters and returns the maximum height possible for the smallest flower.

Expected Time Complexity: O(NLogN)
Expected Auxiliary Space: O(1)

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/899540d741547e2d75d1c5c03a4161ab53affd13/1

Powered by hirist.com
πŸ‘1
Problem Of The Day
"Find anagrams in linked list"

Solve the problem to win points

Given a linked list of characters and a string S.Return all the anagrams of the string present in the given linked list.In case of overlapping anagrams choose the first anagram from left.

Example 1:
Input: a -> b -> c -> a -> d -> b -> c -> a
S = bac
Output: [a -> b -> c, b -> c -> a]
Explanation: In the given linked list,
there are three anagrams:
1. a -> b -> c -> a -> d -> b -> c -> a
2. a -> b -> c -> a -> d -> b -> c -> a
3. a -> b -> c -> a -> d -> b -> c -> a
But in 1 and 2, a -> b -> c and b -> c-> a
are ovelapping.So we take a -> b -> c as it
comes first from left.So the output is:
[a->b->c,b->c->a]

Example 2:
Input: a -> b -> d -> c -> a
S = bac
Output: -1
Explanation: There is no anagrams, so output is -1

Your Task:
You don't need to read input or print anything. Your task is to complete the function findAnagrams() which takes head node of the linked list and a string S as input parameters and returns an array of linked list. If there is no anagram in the linked list,return -1.


Expected Time Complexity: O(N), where N is length of LinkedList
Expected Auxiliary Space: O(1)

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/de6f6a196aecdfb3e4939ba7729809a5a4bdfe90/1

Powered by hirist.com
πŸ‘5
Problem Of The Day
"Maximum Triplet product"

Solve the problem to win points

Given an array arr of size n, the task is to find the maximum triplet product in the array.

Example 1:
Input:
n = 4
arr[] = {1, 2, 3, 5}
Output:
30
Explanation:
5*3*2 gives 30. This is the maximum possible
triplet product in the array.

Example 2:
Input:
n = 7
arr[] = {-3, -5, 1, 0, 8, 3, -2}
Output:
120
Explanation:
-3*-5*8 gives 120. This is the maximum possible triplet product in the array.

Your Task:
You don't need to read input or print anything. Your task is to complete the function maxTripletProduct() which takes an integer n and an array arr and returns the maximum triplet product in the array.


Expected Time Complexity: O(n)
Expected Auxiliary Space: O(1)

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/d54c71dc974b7db3a200eb63f34e3d1cba955d86/1

Powered by hirist.com
πŸ‘5
Must Learn!πŸ’‘
If you are a Linux user, you can explore various desktop environments to tweak your GUI, like Windows and macOS.

the enormous list of desktop environments may confuse you when choosing the correct one for the system.

So, in this article, we will give you brief information about the best Linux desktop environments. Give it a read.

Link- https://www.geeksforgeeks.org/best-linux-desktop-environments/?utm_source=Telegram&utm_medium=marketingteam_gfgmain&utm_campaign=9BestLinuxDesktopEnvironments
No more wait! It's time to take action!!!

Hurry up and enjoy the best opportunities at Job Fair 2023.πŸ˜ƒπŸ™Œ

Link- https://practice.geeksforgeeks.org/jobs?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=jobfair2023
Problem Of The Day
"Yet another query problem"

Solve the problem to win points

You are given an array of N elements and num queries, In each query you are given three numbers L,R and K and you have to tell, how many indexes are there in between L and R(L<=i<=R) such that the frequency of a[i] from index i to n-1 is k.

Note: 0-based indexing

Example 1:
Input:
N=5
num=3
A={1,1,3,4,3}
Q={{0,2,2},{0,2,1},{0,4,2}}
Output:
2 1 2
Explanation:
For query 1: 0 2 2
L=0,R=2,K=2
let, L<=i<=R
For i=0: frequency of a[i] i.e. 1 from i to n-1 is 2.
For i=1: frequency of a[i] i.e. 1 from i to n-1 is 1.
For i=2: frequency of a[i] i.e. 3 from i to n-1 is 2.
Hence we have two elements from index 0 to 2
whose frequency from i to n-1 is 2.

For query 2: 0 2 1
L=0,R=2,K=1
As we can see from the above query that there is
only a single element in 0 to 2 whose frequency
from i to n-1 is 1.

For query 3: 0 4 2
The answer will be 2 because of the index 0 and 2.

Example 2:
Input:
N=5
num=2
A={1,1,1,1,1}
Q={{0,4,2},{0,4,1}}
Output:
1 1
Explanation:
For query 1: 0 4 4
L=0,R=4,K=4
let, L<=i<=R
For i=0: frequency of a[i] i.e. 1 from i to n-1 is 5.
For i=1: frequency of a[i] i.e. 1 from i to n-1 is 4.
For i=2: frequency of a[i] i.e. 1 from i to n-1 is 3.
For i=3: frequency of a[i] i.e. 1 from i to n-1 is 2.
For i=4: frequency of a[i] i.e. 1 from i to n-1 is 1.
Hence we have one elements from index 0 to 4 whose frequency from i to n-1 is 2.

Similarly For query 2:
there is only 1 element in 0 to 4 whose frequency from i to n-1 is 1.
Expected Time Complexity: O(N2)
Expected Auxiliary Space: O(N2)

Your Task:
You don't need to read input or print anything. Your task is to complete the function solveQueries() which take two variable N and num representing the length of the original array and number of queries and two arrays as input, A and Q representing the original array and an array of queries(2-D array with 3 columns of L,R and K respectively), and returns the array of length num with the solution to each query.

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/ad6699d4aaf84c74b119fac3b65e9ceb3fc8ef14/1

Powered by hirist.com
πŸ‘3
Must Learn!πŸ’‘
Software Development holds the title of being among the high paying jobs.

However, it's a half-truth. There are many other jobs that are as in-demand and high-paying as Software Development.

We have brought a list of the 10 highest-paying technical jobs other than software developers to help you in deciding which one suits you better.

Also in this article, minimum eligibility criteria are mentioned in case you need to enter into that particular field. Give it a read.

Link- https://www.geeksforgeeks.org/highest-paying-technical-jobs-other-than-software-developers/?utm_source=Telegram&utm_medium=marketingteam_gfgmain&utm_campaign=highest-paying-jobs-other-than-software-development
πŸ‘3❀1πŸ‘Ž1
Problem Of The Day
"Binary matrix having maximum number of 1s"

Solve the problem to win points

Given a binary matrix (containing only 0 and 1) of order NxN. All rows are sorted already, We need to find the row number with the maximum number of 1s. Also, find the number of 1s in that row.
Note:

1. In case of a tie, print the smaller row number.
2. Row number should start from 0th index.

Example 1
Input:
N=3
mat[3][3] = {0, 0, 1,
0, 1, 1,
0, 0, 0}
Output:
Row number = 1
MaxCount = 2
Explanation:
Here, max number of 1s is in row number 1
and its count is 2.

Example 2
Input:
N=3
mat[3][3] = {1, 1, 1,
1, 1, 1,
0, 0, 0}
Output:
Row number = 0
MaxCount = 3
Your Task:
You don't need to read input or print anything. The task is to complete the function findMaxRow() which takes mat[][] as the 2D matrix and N as the size of matrix. Your task is to find the row number with the maximum number of 1s and find the number of 1s in that row and return the answer in a vector of size 2 where at 0th index will be the row number and at 1th index will be MaxCount.

Expected Time Complexity: O(N)
Expected Auxiliary Space: O(1)

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/77e1c3e12cd148f835d53eb168d4472b2ff539fa/1

Powered by hirist.com
πŸ‘1
Must Learn!πŸ’‘
The best way to master a new skill is to practice it and implement those by building some projects.

It’s very important for individuals to learn new concepts and develop some amazing coding projects for beginners to kickstart their careers.

This article is best for the budding coders as it will help them with project idea at initial level.
Give it a read.

Link- https://www.geeksforgeeks.org/coding-projects-for-beginners/?utm_source=Telegram&utm_medium=marketingteam_gfgmain&utm_campaign=coding-projects-for-beginners
πŸ‘2😁1
Problem Of The Day
"Maximum Possible Value"

Solve the problem to win points

Given two arrays A[] and B[] of same length N. There are N types of sticks of lengths specified. Each stick of length A[i] is present in B[i] units (i=1 to N). You have to construct the squares and rectangles using these sticks. Each unit of a stick can be used as length or breadth of a rectangle or as a side of square. A single unit of a stick can be used only once.

Let S be the sum of lengths of all sticks that are used in constructing squares and rectangles. The task is to calulate the maximum possible value of S.

Example 1:
Input:
N = 4
A[] = {3,4,6,5}
B[] = {2,3,1,6}
Output:
38
Explanation:
There are 2 sticks of length 3.
There are 3 sticks of length 4.
There is a 1 stick of length 6.
There are 6 sticks of length 5.
One square can be made using 4 sticks of
4th kind (5*4=20)
A rectangle can be made using 2 sticks of
4th kind and 2 sticks of 2nd kind (5*2+4*2=18)
S = 20 + 18 = 38

Example 2:
Input:
N = 1
A[] = {3}
B[] = {2}
Output:
0
Explanation:
There are only 2 sticks of length 3 which are
not enough to make the square or rectangle.

Your Task:
You don't need to read input or print anything. Complete the function maxPossibleValue( ) which takes the integer N , the array A[], and the array B[] as input parameters and returns the maximum possible value of S.

Expected Time Complexity: O(N)
Expected Auxiliary Space: O(1)

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/2d3fc3651507fc0c6bd1fa43861e0d1c43d4b8a1/1

Powered by hirist.com
πŸ‘4
Only 7 days left...
Don't let your future wait!🀝
Get your dream job at your dream organization.

Hurry up!

Get Hired - https://practice.geeksforgeeks.org/jobs?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=jobfair2023
πŸ‘1πŸ”₯1
Learn more!πŸ’‘
Linux is one the most popular operating systems with a fast-growing user base.

Many users prefer other operating systems because Linux can give a frustrating experience if a user makes some mistakes as a beginner.

This article talks about the common mistakes Linux beginners make, read the following article. Give it a read.

Link- https://www.geeksforgeeks.org/7-common-mistakes-linux-beginners-make/?utm_source=Telegram&utm_medium=marketingteam_gfgmain&utm_campaign=7-common-mistakes-linux-beginners-make
🚨Job Alert🚨
WebOccult Technologies is hiring for AI/ML Developer.

Location - Ahmedabad, Gujarat
Experience - 2 - 8 Years
Apply by - Mar 31, 2023

Apply via the following link and share the opportunity with your friends- https://practice.geeksforgeeks.org/jobs/WebOccult-AIMLDeveloper?utm_source=Telegram&utm_medium=marketingteam_gfgmain&utm_campaign=WebOccult-AIMLDeveloper

πŸ“’: Also, do not miss the chance to get endless opportunities at Jobs Fair 2023 - https://practice.geeksforgeeks.org/jobs?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=jobfair2023
πŸ‘2
Problem Of The Day
"Maximum Number of coins"

Solve the problem to win points

We have been given N balloons, each with a number of coins associated with it. On bursting a balloon i, the number of coins gained is equal to A[i-1]*A[i]*A[i+1].
Also, balloons i-1 and i+1 now become adjacent. Find the maximum possible profit earned after bursting all the balloons. Assume an extra 1 at each boundary.

Example 1:
Input:
N=2
a[]={5, 10}
Output:
60
Explanation: First Burst 5, Coins = 1*5*10
Then burst 10, Coins+= 1*10*1
Total = 60

Example 2:
Input:
N=4
a[] = {3,1,5,8}
Output:
167
Explanation:
nums = [3,1,5,8] --> [3,5,8] --> [3,8] --> [8] --> []
coins = 3*1*5 + 3*5*8 + 1*3*8 + 1*8*1 = 167.
Your Task:
You don't need to read input or print anything. Your task is to complete the function maxCoins() which takes the array arr[], its size N, and returns the maximum number of coins that can be collected.

Expected Time Complexity: O(N^3)
Expected Space Complexity: O(N^2)

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/7ae455e552dc4e07f76bbe2adc4d4207ce1ff16e/1

Powered by hirist.com
πŸ‘2❀1